category_save_pre

category_save_pre is a filter performed on the post_category element of the $_POST array, when publishing a post.

Context:

File: wp-admin/post.php
switch($action) {
case 'post':

	if ( !user_can_create_draft($user_ID) )
		die( __('You are not allowed to create posts or drafts on this blog.') );

	$post_pingback = (int) $_POST['post_pingback'];
	$content         = apply_filters('content_save_pre',  $_POST['content']);
	$excerpt         = apply_filters('excerpt_save_pre',  $_POST['excerpt']);
	$post_title      = apply_filters('title_save_pre',    $_POST['post_title']);
	$post_categories = apply_filters('category_save_pre', $_POST['post_category']);
	$post_status     = apply_filters('status_save_pre',   $_POST['post_status']);
	$post_name       = apply_filters('name_save_pre',     $_POST['post_name']);
	$post_parent = 0;
	$menu_order  = 0;

This hook is a filter which means that information is passed through it, and then used by WordPress. Your function needs to accept that information, and return it. Using add_filter('category_save_pre', 'your_function'); helps you to remember this distinction. When you are passing an ID, it is assumed that you will return the ID as it was given to you. With filters that pass strings or arrays, you may manipulate the information before passing it along.