How to call a custom taxonomy term name inside a function?

You can get the current term slug from the global query. You could do something like this:

if( is_tax('cars') ) {
    //We are in "cars" taxonomy archive page, now get the queried term
    $term = get_query_var( 'term' );
    show_post($term);
}