Following the hint, consider $f(z)=\frac{1}{\sqrt{z} (z^2 + 1)}$ and contour $\gamma$ as shown in given picture.
Then $$\int_{\gamma}{f(z)dz}
=\int^{-\epsilon}_{-R}{f(x)dx}
+ \int^{R}_{\epsilon}{f(x)dx}
+ \int_{\gamma_{\epsilon}}{f(z)dz}
+ \int_{\gamma_{R}}{f(z)dz} $$
Step 1
Fix $0 < \epsilon < 1$ and $R>1$.
Then $f$ is analytic everywhere in $\gamma$ except at $z = i$, where it has a simple pole.
Then by the residue theorem, $$\int_{\gamma}{f(z)dz} = 2\pi i \left[\frac{1}{\sqrt{z}(z+i)}\right]_{z=i} = \frac{2\pi i}{2i\sqrt{i}} = \frac{\pi }{\sqrt{i}} $$ $$= \frac{\pi }{\sqrt{e^{i\pi/2}}} = \frac{\pi }{e^{i\pi/4}} =\frac{\pi }{\cos(\pi/4) + i \sin(\pi/4)} = \frac{\pi }{\frac{1}{\sqrt{2}} + i \frac{1}{\sqrt{2}}}
= \frac{\pi \left(\frac{1}{\sqrt{2}} - i \frac{1}{\sqrt{2}}\right)}{\left(\frac{1}{\sqrt{2}} + i \frac{1}{\sqrt{2}}\right)\left(\frac{1}{\sqrt{2}} - i \frac{1}{\sqrt{2}}\right)}
= \frac{\pi \left(\frac{1}{\sqrt{2}} - i \frac{1}{\sqrt{2}}\right)}{\frac{1}{2}+ \frac{1}{2}}
= \pi \left(\frac{1}{\sqrt{2}} - i \frac{1}{\sqrt{2}}\right)$$
Overcomplicated, but correct. V.I
Note that this holds for all $0 < \epsilon < 1$ and $R>1$.
Step 2
$$\int^{-\epsilon}_{-R}{f(x)dx} = \int^{-\epsilon}_{-R}{\frac{1}{\sqrt{x} (x^2 + 1)}dx} = \int^{\epsilon}_{R}{\frac{1}{\sqrt{-x} (x^2 + 1)} (-dx)} = \int^{R}_{\epsilon}{\frac{1}{\sqrt{-x} (x^2 + 1)}dx} = \frac{1}{i} \int^{R}_{\epsilon}{\frac{1}{\sqrt{x} (x^2 + 1)}dx} $$
Step 3
$$\int^{R}_{\epsilon}{f(x)dx} = \int^{R}_{\epsilon}{\frac{1}{\sqrt{x} (x^2 + 1)}dx} $$
Step 4
Consider $\left\lvert{\int_{-\gamma_{\epsilon}}{f(z)dz}}\right\lvert$. With the parametrization $z = \epsilon e^{i\theta}$ for $\theta\in[0,\pi]$.
$$\left\lvert{\int_{-\gamma_{\epsilon}}{f(z)dz}}\right\lvert
= \left\lvert{\int_{0}^{\pi}{\frac{i\epsilon e^{i\theta}}{\sqrt{\epsilon e^{i\theta}} ((\epsilon e^{i\theta})^2 + 1)}d\theta}}\right\lvert
\leq {\int_{0}^{\pi}{
\frac{\left\lvert i\epsilon e^{i\theta}\right\lvert}
{\left\lvert\sqrt{\epsilon e^{i\theta}}\right\lvert \left\lvert (\epsilon e^{i\theta})^2 + 1\right\lvert}
d\theta}}
= \int_{0}^{\pi} \frac{\epsilon}{\sqrt{\epsilon} \left\lvert (\epsilon e^{i\theta})^2 + 1\right\lvert}d\theta
\leq \int_{0}^{\pi} \frac{\epsilon}{\sqrt{\epsilon} (1 - \epsilon^2)}d\theta
= \frac{\pi\epsilon}{\sqrt{\epsilon} (1 - \epsilon^2)}
$$
$$\lim_{\epsilon \to 0^+}{\frac{\pi\epsilon}{\sqrt{\epsilon} (1 - \epsilon^2)}} = \lim_{\epsilon \to 0^+}{\frac{\pi\sqrt{\epsilon}}{ (1 - \epsilon^2)}} = \frac{0}{1} = 0$$
This implies that $$\lim_{\epsilon \to 0^+}{\left\lvert{\int_{-\gamma_{\epsilon}}{f(z)dz}}\right\lvert} = 0 $$
Which then gives $$\lim_{\epsilon \to 0^+}{{\int_{-\gamma_{\epsilon}}{f(z)dz}}} = 0 $$ and thus $$\lim_{\epsilon \to 0^+}{{\int_{\gamma_{\epsilon}}{f(z)dz}}} = -0 = 0 $$
Step 5
Consider $\left\lvert{\int_{\gamma_{R}}{f(z)dz}}\right\lvert$. With the parametrization $z = R e^{i\theta}$ for $\theta\in[0,\pi]$.
$$\left\lvert{\int_{\gamma_{R}}{f(z)dz}}\right\lvert
= \left\lvert{\int_{0}^{\pi}{\frac{iR e^{i\theta}}{\sqrt{R e^{i\theta}} ((R e^{i\theta})^2 + 1)}d\theta}}\right\lvert
\leq {\int_{0}^{\pi}{
\frac{\left\lvert iR e^{i\theta}\right\lvert}
{\left\lvert\sqrt{R e^{i\theta}}\right\lvert \left\lvert (R e^{i\theta})^2 + 1\right\lvert}
d\theta}}
= \int_{0}^{\pi} \frac{R}{\sqrt{R} \left\lvert (R e^{i\theta})^2 + 1\right\lvert}d\theta
\leq \int_{0}^{\pi} \frac{R}{\sqrt{R} (R^2-1)}d\theta
= \frac{\pi R}{\sqrt{R} (R^2-1)}
$$
$$\lim_{R \to \infty}{\frac{\pi R}{\sqrt{R} (R^2 - 1)}} = \lim_{R \to \infty}{\frac{\pi}{\sqrt{R} (R - \frac{1}{R})}} = \frac{\pi}{\infty \cdot \infty} = 0$$
This implies that $$\lim_{R \to \infty}{\left\lvert{\int_{\gamma_{R}}{f(z)dz}}\right\lvert} = 0 $$
Which then gives $$\lim_{R \to \infty}{{\int_{\gamma_{R}}{f(z)dz}}} = 0 $$
Altogether, as $\epsilon \to 0^+$ and $R \to \infty$, the equation $\int_{\gamma}{f(z)dz}
=\int^{-\epsilon}_{-R}{f(x)dx}
+ \int^{R}_{\epsilon}{f(x)dx}
+ \int_{\gamma_{\epsilon}}{f(z)dz}
+ \int_{\gamma_{R}}{f(z)dz} $ becomes
$$ \pi \left(\frac{1}{\sqrt{2}} - i \frac{1}{\sqrt{2}}\right) = \frac{1}{i} I + I + 0 + 0 $$
Equating the real part of the equation gives $$\frac{\pi}{\sqrt{2}} = I$$
Checking: equating the imaginary part of the equation gives $$-\frac{i\pi}{\sqrt{2}} = \frac{1}{i}I$$
which gives $$I = \frac{\pi}{\sqrt{2}}$$ as well.