I would highly recommend Daniel’s much simpler solution
I would highly recommend Daniel’s much simpler solution over the one currently selected as correct:
$user = get_userdata( $user_id );
if ( $user == false ) {
//user id does not exist
} else {
//user id exists
}