This problem is from Chapter 7 of Rudin's Principles of Mathematical Analysis.
Suppose $g$ and $f_n$ ($n = 1,2,3,...)$ are defined on $(0,\infty)$, are Riemann-integrable on $[t,T]$ whenever $0 < t < T < \infty$, $|f_n| \leq g, f_n \to f$ uniformly on every compact subset of $(0,\infty)$, and $$\int_{0}^{\infty}g(x) dx < \infty.$$ Prove that $$\lim_{n\rightarrow \infty} \int_{0}^\infty f_n(x) dx = \int_{0}^{\infty} f(x) dx.$$
My attempt at the solution:
Since $|f_n| \leq g$ and $\int_0^\infty g(x) dx < \infty$, it follows that $\int_0^\infty f_n(x) dx < \infty$ (and also $\int_0^\infty f(x) dx < \infty$ by uniform convergence). Also, $$ \lim_{n \to \infty} \int_{0}^\infty f_n(t) dt = \lim_{n \to \infty} \lim_{T \to \infty} \int_{0}^T f_n(t) dt. $$ If we could interchange the two limits $\lim_{n \to \infty} \lim_{T \to \infty}$, then we would have our result due to the fact that $f_n \in \mathscr{R}$ and $f_n \to f$ (Theorem 7.16).
My question:
What is the formal justification for being able to interchange the two limits? I have had a few ideas, but none of them have seemed any good.
We can find for sufficiently large $n$
$$\begin{align}\left|\int_0^\infty f_n - \int_0^\infty f\right| &\leqslant \left|\int_t^T f_n - \int_t^T f\right| \\&+ \left|\int_0^t f_n\right| + \left|\int_0^t f\right| \\&+ \left|\int_T^\infty f_n\right| + \left|\int_T^\infty f\right| \leqslant \epsilon\end{align}$$
The first term on the RHS tends to $0$ as $n \to \infty$ since $f_n$ converges uniformly to $f$ on $[t,T]$. Hence, for any $\epsilon > 0$ and fixed $t,T$ we have for sufficiently large $n$,
$$\left|\int_t^T f_n - \int_t^T f \right| < \epsilon/5$$
Each of the remaining terms on the RHS can be made smaller than $\epsilon/5$ by choosing a sufficiently small $t$ and sufficiently large $T$ (independent of $n$) using, for example, the estimate
$$\left|\int_T^\infty f_n\right| \leqslant \int_T^\infty |f_n| \leqslant \int_T^\infty |g| \leqslant \epsilon/5,$$
where the last inequality follows from the convergence of $\int_0^\infty g$.