continuous functions above and below a characteristic function If $\chi_{[a,b)}:[0,1]\rightarrow \{0,1\}$ is the characteristic function of a subinterval $[a,b)\subseteq [0,1)$ then how can one show that for arbitrary $\varepsilon >0$ that there exist functions $f,g \in C[0,1]$ such that $f(x) \leqslant \chi_{[a,b)}(x) \leqslant g(x) $ on $[0,1]$ and $\int_{0}^{1}\left[g(x)-f(x)\right] \, dx \leqslant \varepsilon$?
This makes sense intuitively to me and I can create $f,g$ that satisfy the latter properly but I don't know how to ensure $f,g$ also satisfy the former property (continuous). Is it to do with the Darboux Criterion of integrability?
 A: Suppose $0 < a < b < 1$.  Take $\delta \leqslant \epsilon/2$ such that $a - \delta \geqslant 0$.  Define continuous piecewise linear functions,
$$g(x) = \begin{cases}0,& 0 \leqslant x \leqslant a - \delta\\ 1+\delta^{-1}(x - a ), &a- \delta < x \leqslant a\\1,& a < x \leqslant b\\1 - \delta^{-1}(x - b),&b < x \leqslant b+\delta\\0,& b+\delta < x \leqslant 1 \end{cases} \\f(x) = \begin{cases}0,& 0 \leqslant x \leqslant a \\ \delta^{-1}(x - a ), &a < x \leqslant a+\delta\\1,& a+\delta < x \leqslant b-\delta\\\delta^{-1}(b - x),&b-\delta < x \leqslant b\\0,& b < x \leqslant 1 \end{cases} $$
Then $f(x) \leqslant \chi_{[a,b)}(x) \leqslant g(x)$ for all $x \in [a,b]$.  We have $g(x) = f(x)$ except on the intervals $(a - \delta,a+ \delta)$ and $(b- \delta, b+\delta)$.  The region between the graphs over these two intervals are parallelograms with height $1$ and base $\delta$  and, thus,
$$\int_0^1 |g(x) - f(x)| \, dx = 2 \cdot \delta \cdot 1 = 2\delta \leqslant \epsilon.$$
The case where $a = 0$is handled in a similar way.
