I'll give an approach different from all of the above using complex analysis, which saves you from a lot of trigonometry and elementary algebraic manipulations. (This might be more likely the preferred approach of the problem, since it uses the variable $z$, which commonly denotes a complex variable.)
Note that the denominator $z^2+25=(z+5i)(z-5i)$ contains complex roots. Hence the integral is susceptible to the technique of integrating over a closed curve on the complex plane and applying the residue theorem.
More specifically, consider the half-circle $\gamma$ on the complex plane with the straight edge sitting on the real interval $[-R,R]$ and with the arc $Re^{i\theta}$ where $\theta\in[0,\pi]$. The function is rational, hence meromorphic, and the root $z=5i$ (with multiplicity $1$) is included inside this half-circle when $R>5$. Hence we compute the residue at $z=5i$:
$$\operatorname{res}_{5i}f=\lim_{z\to5i}\frac{z-5i}{(z+5i)(z-5i)}=\frac{1}{10i}$$
Now apply the residue theorem:
$$\int_\gamma f(z)\,dz=2\pi i\operatorname{res}_{5i}f=\frac{2\pi i}{10i}=\frac{\pi}{5}$$
It remains to prove that the integral around the arc $\gamma_R$ goes to $0$ as $R\to\infty$. The function is bounded on this arc by $1/(R^2+25)$, and the arc has length $\pi R$, so by the estimation lemma:
$$\lim_{R\to\infty}\left|\int_{\gamma_R}f(z)\,dz\right|\le\lim_{R\to\infty}\left|\frac{\pi R}{R^2+25}\right|$$
The right hand side has growth rate $O(R)$ in the numerator and $O(R^2)$ in the denominator, so it's straightforward to show that it goes to $0$ as $R\to\infty$ (by e.g. L'Hôpital's rule). Hence the integral on the real line is equal to the integral around the half-circle, that is
$$\int_{-\infty}^{\infty}\frac{1}{z^2+25}\,dz=\frac{\pi}{5}$$
as was required.