# Show that for every $\epsilon>0$ there exists a continuous function $g$ with $\Vert f-g \Vert_{L^p} < \epsilon$ , $f$ is Riemann integrable

Let $$p\in [1,\infty)$$. Given a Riemann integrable function $$f: I \to \mathbb{R}$$ defined on the closed interval $$I \subseteq \mathbb{R}$$, show that for every $$\epsilon >0$$ there exists a continuous function $$g:I\to \mathbb{R}$$ such that

$$\Vert f-g \Vert_{L^p}<\epsilon$$ , where the $$L^p$$-Norm ist defined by $$\left( \int_I\vert h(x) \vert^p\, dx\right)^{\frac{1}{p}}$$ for a Riemann integrable function $$h:I\to \mathbb{R}$$.

I have previously shown that for every $$\epsilon>0$$ there exists a step-function $$S$$ which satisfies the inequality. From my understand step functions are only piecewise continuous, so I thought of maybe using such a step function S and then somehow manipulate it so that it becomes continuous. But I genuinly don't know how to proceed.

• continuous functions of compact support and steps functions are dense in $L_p$ ($1\leq p<\infty)$ an fir such functions, the Riemann and the Lebesgue integral coincide. Jun 11 '20 at 21:41

Hint: Suppose $$f$$ is the step function $$f=0$$ on $$[0,1/2],$$ $$f=1$$ on $$(1/2,1].$$ Can you find a continuous function $$g$$ on $$[0,1]$$ such that $$\int_0^1|f-g|<\epsilon?$$