Use Monotone Convergence Theorem to show that $\int_{E}f = \sum_{n=1}^{\infty} a_{n}$

I am looking at the following problem:

Let $\{a_{n}\}$ be a sequence of nonnegative real numbers. Define the function $f$ on $E=[1,\infty)$ by setting $f(x) = a_{n}$ if $n \leq x < n+1$. Show that $\int_{E}f=\sum_{n=1}^{\infty}a_{n}$ using the Monotone Convergence Theorem.

Now, if we knew that $f$ were measurable, we could use additivity over domains of integration, and the problem would be nice.

However, we cannot, and I can't for the life of me figure out how to use the Monotone Convergence theorem to do this problem. The $\{a_{n}\}$ aren't increasing, so what about this calls for the Monotone Convergence Theorem?? How do I go about proving this?

• Let $f_n=a_n\chi_{[n,n+1)}$. Then $f_n$ is certainly measurable. And $f=\sum f_n$ so $f$ is measurable. Apply MCT to the partial sums of $\sum f_n$. – David C. Ullrich Nov 11 '15 at 15:23

The key point, that is never stressed enough, is what $\sum_{n=1}^\infty a_n$ means. It means, by definition, $$\lim_{N\to\infty}\sum_{n=1}^Na_n.$$ So this is the limit of an increasing sequence of real numbers. So, $$\sum_{n=1}^\infty a_n=\lim_{N\to\infty}\sum_{n=1}^Na_n=\lim_{N\to\infty}\int_E f_n=\int_E f,$$ where $f_n=\sum_{n=1}^N a_n\,1_{(n,n+1]}$ gives an increasing sequence of functionsand the last equality is given by Monotone Convergence.