Incorrect posts displayed on category page

First of all, never ever make use of query_posts. It is not just slow and reruns queries, but it breaks pagination, page functionalities and the globals like $post on which some theme functionalities and plugins rely. If you really need to run custom queries (which is totally unnecessary in this case), make use of WP_Query or get_posts.

All your template files should have the same basic setup, the loop, which should look like this

if ( have_posts() ) {
    while( have_posts() ) {
    the_post();

        // Template tags and HTML mark up

    }
}

No custom queries, no query_posts. The correct poss will be displayed according to the template and page being displayed. If you are on a category page, only posts will be displayed from the selected category. In your code, this line stuffs up everything and should be removed from all template files:

query_posts('showposts=5');

By removing this, all your templates should display what they are suppose to show. If you need to alter anything on your template pages, use pre_get_posts to alter the main query before it is executed.

REFERENCE