Ignoring $0$, you have f\,'(x)=\frac{x\cos x-\sin x}{x^2}\;.
To find where f\,'(x)=0, you need to solve $x\cos x-\sin x=0$. There are clearly no solutions with $\cos x=0$, since $\sin x$ and $\cos x$ are never zero simultaneously, so you can divide through by $\cos x$ to get $x-\tan x=0$.
Consider the case in which $n\ge 0$. (The case $n<0$ is similar in principle.) The only solution to $x=\tan x$ must come in the half interval in which $\tan x>0$, which is $\left[n\pi,\left(n+\frac12\right)\pi\right)$. It’s not hard to check that $y=x$ intersects $y=\tan x$ exactly once on each of these half-intervals. It’s also not hard to check that $x-\tan x$ is positive just to the left of each point of intersection and negative just to the right, so that the critical points really are local extrema. Which kind of extremum depends on whether $n$ is even or odd, since f\,'(x)=\frac{\cos x}{x^2}(x-\tan x)\;, and its algebraic sign is also affected by the factor of $\cos x$.