I'm having trouble proving the following proposition, which is "left to the reader".
Let $f:[a,b]\to \mathbb{R}$ be a bounded function. Let us define $$s(f) := \left\{\int \phi : \phi \text{ is simple, } \phi \leq f\right\}$$ $$S(f) := \left\{\int \phi : \phi \text{ is simple, } \phi \geq f\right\}$$ and $$\underline\int f := \sup s(f)$$ $$\overline\int f := \inf S(f).$$ Show that $f$ is Lebesgue measurable iff $\underline\int f = \overline\int f$.
Supposing that $f$ is Lebesgue measurable, I thought of approximating $f$ using two sequences of simple functions converging "from above" and "from below" to $f$, and evaluate the error in the approximation, but I couldn't develop this idea any further.