The reverse problem can be solved in polynomial time as $a^b$ requires at most $\log b$ recursive calls using the approach given below:
pow(int a, int b)
{
if(b%2)
return a* pow(a*a, b/2);
else
return pow(a*a, b/2);
}
Now, the forward problem is also solvable in polynomial time. We need to check for all the roots of $n$ (from $\sqrt n$ till $n^{\frac{1}{\log n}}$) whether it is an integer . But each of these check can be done in $\log n$ time using a binary search on the set of integers from 2..$n$ and so, the overall complexity will be $(\log n)^2$ which is polynomial in $\log n$ ($\log n$ is the size of input). So, (a) must be the answer.