Add a jQuery Function

First, don’t unregister and reregister jQuery. There’s no reason to do that at all. Second, you’re enqueuing on the wrong hook. Instead, use this in your functions file:

// Enqueue Scripts
function wpse78227_enqueue_scripts() {
    wp_enqueue_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'wpse78227_enqueue_scripts' );

Now, to include that script you need to do a couple of things.

  1. Create a new file in your theme for the script (i.e. jquery.show-hide.js)
  2. Copy that jQuery function into this new file
  3. Enqueue the script file as you would any other

This would then give you:

// Enqueue Scripts
function wpse78227_enqueue_scripts() {
    wp_enqueue_script( 'jquery' );
    wp_enqueue_script( 'jquery-show-hide', get_template_directory_ui() . '/js/jquery.show-hide.js', array( 'jquery' ) );
}
add_action( 'wp_enqueue_scripts', 'wpse78227_enqueue_scripts' );

Assuming your script file is now located in /wp-content/themes/your-theme-name/js/jquery.show-hide.js. It also lists jQuery as a dependency, so you could forgo enqueuing jQuery at all if you want to (When WordPress attempts to load the plugin, it sees the dependency on jQuery and automatically loads it first if it’s not already loaded).