Split the integral into two pieces:
\begin{equation*}
\ds \int_{-\infty}^\infty \dfrac{1}{1+x^2}\, dx = \int_{-\infty}^0 \dfrac{1}{1+x^2}\, dx + \int_0^\infty \dfrac{1}{1+x^2}\, dx
\end{equation*}
For the first piece, we compute:
\begin{align*}
\ds \int_{-\infty}^0 \dfrac{1}{1+x^2}\, dx \amp = \lim_{t\to-\infty} \int_t^0 \dfrac{1}{1+x^2}\, dx\\
\ds \lim_{t\to-\infty} \int_t^0 \dfrac{1}{1+x^2}\, dx \amp = \lim_{t\to -\infty} \lrpar{\inv{\tan}(x)}\bigg\rvert_t^0\\
\ds \lim_{t\to -\infty} \lrpar{\inv{\tan}(x)}\bigg\rvert_t^0 \amp = \lim_{t\to -\infty} \lrpar{\inv{\tan}(0)-\inv{\tan}(t)}\\
\amp = \dfrac{\pi}{2}
\end{align*}
For the second piece, we have a similar computation:
\begin{align*}
\ds \int_0^\infty \dfrac{1}{1+x^2}\, dx \amp = \lim_{t\to\infty} \int_0^t \dfrac{1}{1+x^2}\, dx\\
\ds \lim_{t\to\infty} \int_0^t \dfrac{1}{1+x^2}\, dx \amp = \lim_{t\to \infty} \lrpar{\inv{\tan}(x)}\bigg\rvert_0^t\\
\ds \lim_{t\to \infty} \lrpar{\inv{\tan}(x)}\bigg\rvert_0^t \amp = \lim_{t\to \infty} \lrpar{\inv{\tan}(t)-\inv{\tan}(0)}\\
\amp = \dfrac{\pi}{2}
\end{align*}
Summing the two pieces gives the answer of \(\pi\)