This is a special case of a much more general result. I do not know whether you are supposed to appeal to the general result, or compute explicitly for this case. So we compromise and assume that the general result is still not available, but derive the result using a general technique.
We will (sort of) find the cumulative distribution function $F_Z(z)$ of $Z$. By the definition of $Z$, $F_Z(z)=\Pr(Z\le z)=\Pr(\arctan X \le z).$ Note that this is $0$ if $z\le -\frac{\pi}{2}$ and $1$ if $z\ge \frac{\pi}{2}$. So we only need to deal with $-\frac{\pi}{2}\lt z\lt \frac{\pi}{2}$.
Since $\arctan t$ is an increasing function of $t$, we have $\arctan X\le z$ iff $X\le \tan z$ (we took the $\tan$ of both sides). Thus in the interval $-\frac{\pi}{2}\lt z\lt \frac{\pi}{2}$ we have $F_Z(z)=\Pr(X\le \tan z) =\int_{-\infty}^{\tan z} \frac{dx}{\pi(1+x^2)}.\tag{$1$}$ Now we can take two approaches, the slow one and the fast one. The slow way is to integrate and substitute. The fast way, since ultimately we will want $f_Z(z)$, the density function, is to differentiate the right-hand side of $(1)$ directly. By the usual rules for differentiating under the integral sign, we get $f_Z(z)=\sec^2 z\frac{1}{\pi(1+\tan^2 z)}.$ But $1+\tan^2 z=\sec^2 z$, so there is very nice cancellation, and we conclude that $f_Z(z)=\dfrac{1}{\pi}$. (Recall this was only for $-\pi/2\lt z\lt \pi/2$.)