$$\int_{-\infty}^{\infty}{\frac{1-\cos(2z)}{z^2(z^2+1)}}\, dz$$
The contour is shaped like this (image from this answer) 
With $\epsilon$ being the radius of the smaller semi-circle. The integral over that part specifically is :
$$\begin{align}\int_{\gamma}{f(z)\, dz}&=\int_{\pi}^{0}{\frac{1-e^{2i\epsilon e^{i\theta}}}{(\epsilon e^{i\theta})^2((\epsilon e^{i\theta})^2+1)}i\epsilon e^{i\theta}\, d\theta}\\&=-i\int_{0}^{\pi}{\frac{1-e^{2i\epsilon e^{i\theta}}}{\epsilon^3e^{3i\theta}+\epsilon e^{i\theta}}\, d\theta}\\&\leq\int_{0}^{\pi}{\frac{|1-e^{2i\epsilon e^{i\theta}}|}{|\epsilon^3e^{3i\theta}+\epsilon e^{i\theta}|}\, d\theta}\\&=\frac{1}{|\epsilon^3-\epsilon|}\int_{0}^{\pi}{|1-e^{2i\epsilon e^{i\theta}}|\, d\theta}\end{align}$$
I'm not sure how to bound this though. In the end $\epsilon\to0$, but I'm not sure if that can be used yet. Any hints?
Let $f(z) = \displaystyle\frac{1-\exp\left(2iz\right)}{z^{2}\left(1+z^{2}\right)}$. As $\epsilon \to 0$, here are two ways to evaluate the contour integral over $\gamma$:
$$ \begin{align} \lim_{\epsilon \to 0} \int_{\gamma} f(z)dz &= \lim_{\epsilon \to 0} \int_{\pi}^{0}f\left(\epsilon e^{i\theta}\right)d\left(\epsilon e^{i\theta}\right) \\ &= \int_{\pi}^{0}\lim_{\epsilon \to 0}\frac{1-\exp\left(2i\epsilon e^{i\theta}\right)}{\epsilon^{2}e^{2i\theta}\left(1+\epsilon^{2}e^{2i\theta}\right)}\cdot\epsilon ie^{i\theta}d\theta \\ &= i\int_{\pi}^{0}\lim_{\epsilon \to 0}\frac{\frac{d}{d\epsilon}\left(1-\exp\left(2i\epsilon e^{i\theta}\right)\right)}{\frac{d}{d\epsilon}\epsilon e^{i\theta}\left(1+\epsilon^{2}e^{2i\theta}\right)}d\theta \\ &= i\int_{\pi}^{0}\lim_{\epsilon \to 0}\frac{-\exp\left(2i\epsilon e^{i\theta}\right)\cdot2ie^{i\theta}}{e^{i\theta}+3\epsilon^{2}e^{3i\theta}}d\theta \\ &= i\int_{\pi}^{0}(-2i)d\theta \\ &= -2\pi \end{align} $$ and $$ \begin{align} \lim_{\epsilon \to 0} \int_{\gamma} f(z)dz &= -i\pi \operatorname{Res}(f(z), z=0) \\ &= -i\pi\frac{1}{\left(2-1\right)!}\lim_{z\to0}\frac{d^{2-1}}{dz^{2-1}}\left(z-0\right)^{2}\frac{1-\exp\left(2iz\right)}{z^{2}\left(1+z^{2}\right)} \\ &= -i\pi \lim_{z\to0}\frac{d}{dz}\frac{1-\exp\left(2iz\right)}{1+z^{2}} \\ &= -i\pi \lim_{z\to0}\frac{-2z+2e^{2iz}\left(-iz^{2}+z-i\right)}{\left(1+z^{2}\right)^{2}} \\ &= -i\pi\left(-2i\right) \\ &= -2\pi. \end{align} $$
From here, I'm sure you will be able to prove that $$ \int_{-\infty}^{\infty}\frac{1-\cos\left(2x\right)}{x^{2}\left(x^{2}+1\right)}dx = \pi+\frac{\pi}{e^{2}}. $$