I want to prove that if $f:\mathbb{R}\to\mathbb{R}$ is Lebesgue-integrable, then for every $\epsilon >0$ there exists $g:\mathbb{R}\to\mathbb{R}$ continuous such that $\displaystyle\int_{\mathbb{R}}|f-g|<\epsilon$ (I will write the integral simply $\displaystyle\int|f-g|$).
I already know how to approximate $f$ by simple functions.
Now, in the following link:
Finding simple, step, and continuous functions to satisfy Lebesgue integral conditions
The author of the chosen answer proves that for the characteristic function $[E ]$ and $\epsilon >0$, there is a continuous function $\phi:\mathbb{R}\to [0,1]$ such that $\displaystyle\int |[ E]-\phi|<\epsilon$, but he uses the regularity which is only valid if $E$ is of finite measure.
Is this still valid if $E$ isn't of finite measure? Or at least, I'm trying to do the case when $E$ is $\sigma$-finite, because I'm interested when $E=\mathbb{R}$.
Any suggestion? Thanks.
Shouldn't it be $\int |f-g_j|=\int_{[-j,+j]|f-g_j|}+\int_{\mathbb{R}\setminus{[-j,+j]}}|f-g_j|$?
– Surtan Mar 22 '15 at 22:06