show the author’s role along with the name in the single.php

To get author role in single.php you have to get author id first. Use following code to get author id

$author_id = get_the_author_meta( 'ID' );

Then get userdata using

$user = get_user_by( 'ID', $author_id); 

or you can use

$user = get_userdata( $author_id );

now you can display role of author using :

echo implode(', ', $user_info->roles);