In response to @Cameron Williams' hint and comments, I am going to attempt the solution.
We have $f(z) = \frac{1}{(z^2+1)^2}$. Let $C$ be the half circle as described by @Cameron Williams. Now, we have $z = i$ to be the singularity point inside $C$.
In finding the residue,
\begin{align}
\text{Res}_{z = i} f(z) &= \text{Res}_{z = i} \frac{1}{(z^2+1)^2} = \text{Res}_{z = i} \frac{1}{(z+i)^2(z-i)^2} \\
&= \frac{d}{dz} \frac{1}{(z+i)^2} \Bigg\vert_{z=i} = -\frac{2}{(z+i)^3} \Bigg\vert_{z=i} = \frac{1}{4i}
\end{align}
For the horizontal line and half-circle arc, we have $z = x$ and $z=Re^{i \theta}$ respectively. Employing the residue theorem for integrals, we have
\begin{align}
\int_C f(z) \, dz = \int_{-R}^{R} \frac{1}{(x^2+1)^2} \, dx + \int_{0}^{\pi} \frac{1}{(Re^{i \theta}+1)^2} (iRe^{i \theta} \, d\theta) = 2\pi i \, \text{Res}_{z = i} f(z) = \frac{\pi}{2}
\end{align}
Taking the limit as $R \rightarrow \infty$, we get
\begin{align}
\int_{-\infty}^{\infty} \frac{1}{(x^2+1)^2} \, dx + 0 = \frac{\pi}{2}
\end{align}
Therefore,
\begin{align}
\int_{0}^{\infty} \frac{1}{(x^2+1)^2} \, dx = \frac{\pi}{4}
\end{align}