# Show that there exist continuous functions $g,h:[0,1]\rightarrow \mathbb{R}$

Let $f:[0,1]\rightarrow \mathbb{R}$ be a Riemann Integrable function. Let $\epsilon>0$. Show that there exist continuous functions $g,h:[0,1]\rightarrow \mathbb{R}$ such that $g(x)\leq f(x)\leq h(x)$ for all $x\in [0,1]$ and $$\int_0^1 (h(x)-g(x))\mathsf dx<\epsilon.$$

My Try:

There exists a partition $P$ such that $U(P,f)-L(P,f)<\epsilon$. But how can I find continuous functions? I want to try this problem myself. So can anybody please give me just a hint?

• Try something simple. Experiment, experiment, always. For example, suppose $f=0, 0\le x < 1/2, f = 1, x\ge 1/2.$ Can you do it in this case? – zhw. Jul 25 '15 at 22:40
• It is very easy to find functions which satisfy the first inequality. But the difficult thing is the second one. – Extremal Jul 25 '15 at 23:00
• – Math1000 Jul 25 '15 at 23:05
• @EpsilonDelta It's not difficult really. Suppose $\epsilon > 0$ is very small. For $g$ connect the points $(0,0), (1/2, 0),(1/2+\epsilon,1), (1,1)$ with straight line segments. For $h$ connect the points $(0,0), (1/2-\epsilon, 0),(1/2,1), (1,1)$ with straight line segments. – zhw. Jul 26 '15 at 1:31