Here is another approach where we first make use of an auxiliary function.
Before proceeding we recall the definitions for the error function $\text{erf}(x)$ and the complementary error function $\text{erfc}(x)$:
$$\text{erf}(x) = \frac{2}{\sqrt{\pi}} \int^x_0 e^{-t^2} \, dt$$
and
$$\text{erfc}(x) = \frac{2}{\sqrt{\pi}} \int^\infty_x e^{-t^2} \, dt,$$
respectively such that
$$\text{erf}(x) = 1 - \text{erfc}(x).$$
The idea here is to consider an auxiliary function, related to our
function of interest $f(a)$, but which turns our to be a constant
function for all $a$ in its domain.
Start by considering the following auxiliary function
\begin{equation}
I(a) = \left (\int^a_0 e^{-t^2} \, dt \right )^2 + \int^1_0
\frac{e^{-a^2 (t^2 + 1)}}{1 + t^2} \, dt, \,\, a > 0.
\tag1
\end{equation}
Note the term appearing between the brackets is nothing more than the error function. On differentiating the auxiliary function with respect to $a$ we obtain
$$I'(a) = 2 e^{-a^2} \int^a_0 e^{-t^2} \, dt - 2a e^{-a^2} \int^1_0
e^{-a^2 t^2} \, dt.$$
In obtaining this result, Leibniz' rule for differentiating under the
integral sign has been used. In the second integral, if a substitution
of $u = at$ is made, the result $I'(a) = 0$ quickly follows showing
the auxiliary function is indeed constant for all $a > 0$. To find the value for this constant, letting $a \to 0^+$ gives
$$I(a) \to \int^1_0 \frac{dt}{1 + t^2} = \frac{\pi}{4},$$
so that $I(a) = \pi/4$ for all $a > 0$.
As the first of the integrals appearing in (1) can be written in terms of the error function we have
\begin{equation}
\int^1_0 \frac{e^{-a^2 (t^2 + 1)}}{1 + t^2} \, dt = \frac{\pi}{4}
\left (1 - \text{erf}^2 (a) \right ).
\tag2
\end{equation}
A similar thing can be done for the complementary error function. In this case we start by considering the following auxiliary function
\begin{equation}
J(a) = \left (\int^\infty_a e^{-t^2} \, dt \right )^2 -
\int^\infty_1 \frac{e^{-a^2 (t^2 + 1)}}{1 + t^2} \, dt, \,\, a > 0.
\tag3
\end{equation}
Again observe the term appearing between the brackets in nothing more than the complementary error function. On differentiating with respect to $a$ we have
$$J'(a) = -2 e^{-a^2} \int^\infty_a e^{-t^2} \, dt + 2a e^{-a^2}
\int^\infty_1 e^{-a^2 t^2} \, dt.$$
A substitution of $u = at$ in the second integral once again reduces
the derivative of the auxiliary function to zero, showing $J(a)$ is constant. Letting $a \to \infty$ in (3) we see
$J(a) \to 0$. Thus $J(a) = 0$ for all $a > 0$. Writing the
first of the integrals in (3) in terms of the
complementary error function, one finds
\begin{equation}
\int^\infty_1 \frac{e^{-a^2 (1 + t^2)}}{1 + t^2} \, dt =
\frac{\pi}{4} \text{erfc}^2 (a).
\tag4
\end{equation}
Adding (2) to (4) yields
\begin{align*}
\int^\infty_0 \frac{e^{-a^2(1 + t^2)}}{1 + t^2} \, dt &= \frac{\pi}{4} \left [\text{erfc}^2 (a) + 1 - \text{erf}^2 (a) \right ]\\
&= \frac{\pi}{4} \left [\text{erfc}^2 (a) + 1 - (1 - \text{erfc}(a))^2 \right ]\\
&= \frac{\pi}{2} \text{erfc} (a).
\end{align*}
Rearranging gives
$$e^{-a^2} \int^\infty_0 \frac{e^{-a^2 t^2}}{1 + t^2} \, dt = \frac{\pi}{2} \text{erfc}(a),$$
or
$$\int^\infty_0 \frac{e^{-a^2 t^2}}{1 + t^2} \, dt = \frac{\pi}{2} e^{a^2} \text{erfc}(a).$$
So for $f(a)$ we finally have
$$f(a) = 2 \int^\infty_0 \frac{e^{-a^2 t^2}}{1 + t^2} \, dt = \pi e^{a^2} \text{erfc}(a), \quad a > 0.$$