Check if current page is taxonomy term
Just to offer a solution that doesn't make use of arg() (which it's advised to avoid where possible according to the docs page)

You can use the menu_get_object() function:

$term = menu_get_object('taxonomy_term', 2);
if ($term) {
  // User is on a taxonomy term page
}