Q:

step function vs integrable function

The Problem:
Let f be an integrable function on $\mathbb{R}$ with Lebesgue measure.  Thern for any $\epsilon >0$ there is a finite collection of intervals $E_1, . . . ,  E_k$ (that is, $E_i = [a_i, b_i])$ and constants $a_1, . . . ,  α_k$, such that $ \int_{\mathbb{R}}{\left| f(x)-\sum_{i=0}^{k}{\alpha_i 1_{E_i}(x)} \right|} dx <\epsilon$
My problem is the start.  How should I begin proving it?  How can I say that these intervals and constant exist? 
Thank you for any help

A:

Hints:

Start by reducing the problem to positive functions (that is, show that if it holds for every positive function, then it also holds for any integrable function). 
Reduce the problem to positive functions with compact support. 
Reduce the problem to simple functions, and in particular to an indicator function. 

Added (it should be safe to say a few more words now) for ease of notation, call a simple function $h=\sum \alpha_j1_{E_j}$ where each $E_j$ is an interval an R-simple function. 

Decompose $f=f_+-f_-$. If $h_+,h_-$ are R-simple such that
$$\int_\mathbb{R}|f_+-h_+|dx<\frac{\epsilon}{2};\quad \int_\mathbb{R}|f_--h_-|dx<\frac{\epsilon}{2}$$
then
$$\int_\mathbb{R}|f-(h_+-h_-)|dx \leq \int_\mathbb{R}|f_+-h_+|dx + \int_\mathbb{R}|f_--h_-|dx\leq \epsilon.$$
We can therefore assume w.l.o.g.  that $f$ is positive. 
$f\ 1_{[-n,n]}\to f$ pointwise, and by the monotone convergence theorem we can take $n$ such that $$\int_\mathbb{R}|f-f\ 1_{[-n,n]}|dx\leq\frac{\epsilon}{2}.$$
If $h$ is R-simple and $\int_\mathbb{R}|f\ 1_{[-n,n]}-h|dx\leq\frac{\epsilon}{2}$, then w.l.o.g.  $h$ is also supported in $[-n,n]$, and we have $$\int_\mathbb{R}|f-h|dx\leq\int_\mathbb{R}|f-f\ 1_{[-n,n]}|dx+\int_\mathbb{R}|f\ 1_{[-n,n]}-h|dx\leq\epsilon.$$
We can therefore assume w.l.o.g.  that $f$ is compactly supported. 
The definition of Lebesgue integral affords us a simple function $g$ dominated by $f$ (hence also compactly supported) such that $\int_\mathbb{R}|f-g|dx<\frac{\epsilon}{2}$. Again, if $h$ is R-simple and $\int_\mathbb{R}|g-h|dx\leq\frac{\epsilon}{2}$, then
$$\int_\mathbb{R}|f-h|dx\leq \int_\mathbb{R}|f-g|dx + \int_\mathbb{R}|g-h|dx\leq\epsilon.$$
We can therefore assume w.l.o.g.  that $f$ is a compactly supported simple function.  Moreover, by a similar process to (1), we can assume w.l.o.g.  that $f$ is a compactly supported indicator function. 

We're left needing only to prove the proposition for $f=1_A$ for some bounded and measurable $A$.  The regularity of the Lebesgue measure admits $K\subset A\subset G$, $K$ compact and $G$ open, such that $\int_{G\setminus K}dx<\epsilon$. By compactness, we have finitely many open intervals $E_1,\ldots,E_n$ such that $K\subset \bigcup E_j\subset G$, and it can now be easily shown that $E^\prime_i = E_i\setminus\bigcup_{j=1}^{i-1}E_j$ is a finite union of disjoint intervals and that $\int_\mathbb{R}|f-\sum 1_{E^\prime_i}|dx\leq\epsilon$.

