I am trying to evaluate
$$\int_0^\infty \frac{\log(1+x^2)}{x^2} dx $$
by using contour integration. It is possible to compute this integral using real techniques; integration by parts yields the result:
$$\int_0^\infty \frac{\log(1+x^2)}{x^2} dx = \pi$$
I have been attempting to use the integrand $f(z)= \frac{\log(1+z^2)}{z^2}$ (with any suitable branch cut in the lower half plane), and have been trying to integrate around an indented semi-circle in the upper half plane, but I feel this is perhaps the wrong approach. Firstly, when summing the integrals along the real axis, the imaginary part seems to not converge. Furthermore, the indentation integral seems difficult to evaluate. Any help would be appreciated.

See this answer for a way to deal with such logs using contour integration. Note that, about each branch point, we replace the offending log with a factor of $-i 2 \pi$ to account for the phase jump introduced by traversing around the branch point in a clockwise direction.
In this case, you can use a semicircular contour of radius $R$ in the upper half plane, with a detour downward from the semicircle at $\theta=\pi/2$ that avoids the branch point at $z=i$, as pictured below:
Thus, in the limit as $R \to \infty$, the contour integral is equal to
$$\int_{-\infty}^{\infty} dx \frac{\log{(1+x^2)}}{x^2} - i 2 \pi \int_{e^{i \pi/2}}^{\infty e^{i \pi/2}} \frac{dy}{y^2} $$
By Cauchy's Theorem, the contour integral is zero because there are no poles inside this contour. Thus, we have
$$\int_{-\infty}^{\infty} dx \frac{\log{(1+x^2)}}{x^2} = \frac{i 2 \pi}{i} = 2 \pi $$