Suppose a function $f$ is Riemann integrable over any interval $[0,b]$. By definition the improper integral is convergent if there is a real number $I$ such that
$$\lim_{b \to \infty}\int_0^b f(x) dx= I := \int_0^\infty f(x)dx.$$
I have shown that if $f$ is nonnegative then this is equivalent for $n \in \mathbb{N}$ to
$$\lim_{n \to \infty}\int_0^n f(x) dx = I.$$
Now I would like to know for general $f$ (not just nonnegative) if the following proposition holds.
Suppose the improper integral of $f$ over $[0,\infty)$ is convergent. Let $A_n \subset [0, \infty)$ be a nested sequence of compact sets such that $A_1 \subset A_2 \subset A_3 \subset ...$ and $\cup_n A_n =[0,\infty)$, and where the Riemann integral is defined on each $A_n$. Then
$$\lim_{n \to \infty} \int_{A_n}f(x) dx = \int_0^\infty f(x) dx.$$
This question is not about Lebesgue integration. Thank you for any help you can give me.