# staircase functions with compact support are dense in $L^1(\mathbb{R}^n)$

I would like to know how to prove that staircase functions with compact support are dense in $L^1.$ the hint I got was to use the fact that continuous functions with compact support are dense in $L^1.$ So far I couldn't approximate continuous functions with compact support by staircase function. thanks. staircase function: http://en.wikipedia.org/wiki/Step_function

-

Continuous function $f$ on a compact interval (say of length $L$) is uniformly continuous. So for every $\epsilon / L > 0$ you can find $\delta > 0$ so that whenever $|x-y| < \delta$ it holds that $|f(x) - f(y)| < \epsilon / L$.
So, whenever you want to approximate the continuous function with step function to the precision of $\epsilon$, just use the previous argument to find some $\delta$, use it to partition the original interval into $[L/\delta]$ subintervals and define a step function $g$ having for every interval of the partition constant value $f(x)$ where $x$ belongs to the interval. Then $$\int |f(x) - g(x)| dx \leq L \cdot (\epsilon / L) = \epsilon.$$
I just realized that your question perhaps isn't about $L^1(\mathbb R)$ but general $L^1$ spaces. Nevertheless, one can use the compactness in much the same way to cover the support with finite number of sets on which $f$ is nearly constant. – Marek Feb 27 '13 at 15:17