Prove that $\lim_{n \rightarrow \infty} \int_0^\infty f_n(x) dx = \int_0^\infty f(x) dx$. 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. 
 A: 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$.
A: Hint: Prove that the upper and lower Riemann integrals converge to the upper and lower Riemann integrals of the limit function. The idea is that for sufficiently large $n$, the upper and lower sums are within $\epsilon I$ of the upper and lower limit sums respectively. The fact that closed real intervals are compact will play a role.
A: Let $\varepsilon>0$ be given. Since $g \in \mathcal{R}$, we may find $T>t>0$ so that
\begin{align}
\int_T^\infty g(x) dx \leq\frac{\varepsilon}{6}
\end{align}
and
\begin{align}
\int_0^t g(x) dx \leq\frac{\varepsilon}{6} \, .
\end{align}
Since $f_n \to f$ uniformly on $[t, \, T]$, there is a positive integer $N$ so that
\begin{align}
|f_n(x) - f(x)| < \frac{\varepsilon}{3(T-t)} \, \text{  whenever } n \geq N\text{  and  } x \in [t, \, T] \, .
\end{align}
Therefore
\begin{align}\left|\int_0^\infty f_n(x)dx - \int_0^\infty f(x)dx\right| &\leq \left|\int_t^T f_n(x)dx - \int_t^T f(x)dx\right| \\&+ \left|\int_T^\infty f_n(x)dx\right| + \left|\int_T^\infty f(x)dx\right| \\&+ \left|\int_0^t f_n(x)dx\right| + \left|\int_0^t f(x)dx\right| \leq \frac{\varepsilon}{3}+\frac{\varepsilon}{6}+\frac{\varepsilon}{6}+\frac{\varepsilon}{6}+\frac{\varepsilon}{6}
\end{align}
whenever $n \geq N$.
