Prove the definition of Riemann Integration for Step Functions $f$ is RI on $[a,b]$ iff $\forall \epsilon > 0 \exists h_1,h_2$ (two step functions) s.t.
$h_1 \leq f \leq h_2$ and s.t.
$$\int_{a}^{b} (h_2(x) - h_1(x)) dx \leq \epsilon$$
I am thinking if I break the integral,
$\int_{a}^{b} h_2(x)dx - \int_{a}^{b}  h_1(x) dx \leq \epsilon$
And then somehow get both of these to correspond to $\frac{\epsilon}{2}$, I'd have the result. how to get there though, I'm not quite sure. I need to somehow make these step functions into regular functions to use the definitions I know. Does anyone have any advice on how to do this one?
 A: For any partition $P:a < x_0< x_1 < \ldots < x_n = b$, define  $M_j = \sup \{f(x) \, | \, x \in [x_{j-1},x_j]\}$ and  $m_j = \inf \{f(x) \, | \, x \in [x_{j-1},x_j]\}$, and the step functions
$$h_1(x) = \begin{cases}\sum_{j=1}^n m_j \mathbf{1}_{[x_{j-1},x_j)}(x), & a \leqslant x < b\\f(b), &x = b\end{cases}\\ h_2(x) = \begin{cases}\sum_{j=1}^n M_j \mathbf{1}_{[x_{j-1},x_j)}(x), & a \leqslant x < b\\f(b), &x = b\end{cases}$$
We have $h_1(x) \leqslant f(x) \leqslant h_2(x)$ for all $x \in [a,b]$ and
$$\int_a^b(h_2(x) - h_1(x)) \, dx = \sum_{j=1}^nM_j(x_j- x_{j-1}) - \sum_{j=1}^nm_j(x_j- x_{j-1}) = U(P,f) - L(P,f)$$
If $f$ is Riemann integrable, then for any $\epsilon > 0$ there exists a partition $P$ such that the difference between the upper and lower Darboux sums is less than $\epsilon$, that is $U(P,f) - L(P,f)< \epsilon$, which proves the forward implication.
For the reverse implication, step functions are integrable (although this is already assumed in the statement).
Since, $h_1 \leqslant f \leqslant h_2$, we have
$$ \inf \{h_1(x) \, | \, x \in [x_{j-1},x_j]\}\leqslant m_j \leqslant M_j \leqslant  \sup \{h_2(x) \, | \, x \in [x_{j-1},x_j]\},$$
and
$$L(P, h_1) \leqslant L(P,f) \leqslant U(P,f) \leqslant U(P,h_2)$$
Thus,
$$\int_a^b h_1(x)\, dx =\sup_PL(P,h_1)\leqslant \sup_PL(P,f) = \underline{\int_a}^bf(x) \, dx \\\leqslant \overline{\int_a^b}f(x) \, dx = \inf_PU(P,f) \leqslant \inf U(P,h_2)=\int_a^bh_2(x) \, dx  $$
Hence, for any $\epsilon > 0$ there exist step functions $h_1$ and $h_2$ such that
$$0 \leqslant \overline{\int_a^b}f(x) \, dx - \underline{\int_a}^bf(x) \, dx\leqslant \int_a^b(h_2(x)-h_1(x)) \, dx \leqslant \epsilon,$$
and the upper an lower Darboux integrals of $f$ must be equal, proving the reverse implication that $f$ is Riemann integrable.
