get_* functions are return functions. They don't actually print anything. Given your code example, all you should need is an echo statement:
<?php
global $post;
$category = reset(get_the_category($post->ID));
$category_id = $category->cat_ID;
?>
<a class="button" href="<?php echo get_category_link( $category_id ); ?>">← Back to Portfolio</a>
ALTERNATIVE: The best way of doing this would be to keep everything in your loop for reuse in single or archive views, combined with the use of wp_get_post_categories. This is untested, but it should get you started with a general-use method of listing categories associated with a given post or set of posts:
<?php
if(have_posts()) : while(have_posts()) : the_post();
$cats = wp_get_post_categories($post->ID);
if($cats) : foreach($cats as $cat) : $category = get_category($cat);
?>
<a class="button" href="<?php echo get_category_link($category->cat_ID); ?>">← <?php echo $category->name ?></a>
<?php
endforeach;endif;
endwhile;endif;
?>
Answer from maiorano84 on Stack OverflowWordPress
get_category_link() – Function | Developer.WordPress.org
You must log in to vote on the ... log in to vote on the helpfulness of this note ... <?php // Get the ID of a given category $category_id = get_cat_ID( 'Category Name' ); // Get the URL of this category $category_link = get_category_link( $category_id ); ?> <!-- Print a link to ...
WordPress
get_the_category() – Function | Developer.WordPress.org
You must log in to vote on the helpfulness of this noteVote results for this note: 9You must log in to vote on the helpfulness of this note · Show All Categories as Links This outputs all the categories assigned to the post as links. Must be used inside the loop.
WPExplorer
How to Link to the Current Category in WordPress
September 26, 2023 - This tutorial will show you how to link to the current category for the post you are viewing in WordPress using a code snippet.
WordPress Codex
Linking Posts Pages and Categories « WordPress Codex
When doing so, you may safely omit ... and link to the target with a full path: ... The leading slash means "At the very top of this domain is a directory named wordpress, and inside this directory is a file named index.php". ... The lack of a leading slash means "Inside the current directory ...
WisdmLabs
How To Create A Link To Current Category In WordPress
April 7, 2014 - <a href=”<?php echo $category_link ?>” title=”<?php echo $category_name ?>” > <?php echo $category_name ?> </a>[/pre]
WordPress
get_categories() – Function | Developer.WordPress.org
List Categories and Descriptions This example will list, in alphabetic order, all categories presented as links to the corresponding category archive. Each category description is listed after the category link. <?php $categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ...
WordPress
get_category() – Function | Developer.WordPress.org
Retrieves category data given a category ID or category object.
WordPress
wp_list_categories() – Function | Developer.WordPress.org
Displays or retrieves the HTML list of categories.