Let $E \subseteq \mathbb{R}$ be measurable with $|E| < \infty$, and f a nonnegative, bounded function on E. Prove that $sup \lbrace \int_E \phi : 0 \leq \phi \leq f, \phi$ simple$ \rbrace = inf \lbrace \int_E \psi : f \leq \psi, \psi$ simple$ \rbrace$ implies f is measurable.
In this case "f is measurable" means that $\lbrace x: f(x) > a \rbrace$ is measurable for every real number a.
The whole problem is an "if and only if", and I was able to show the converse of this, but it isn't clear to me how this direction follows. It makes sense, as these two being equal seems like a reasonable condition for the integral existing, which can only happen if f is measurable, but I don't understand how exactly this condition implies f being measurable. There are very few statements that reliably apply to non-measurable sets in a way that I would know how to use to prove this by contradiction or contrapositive, but doing it directly doesn't seem possible either. I can't appeal to any notion of what the integral of f is or should be since I'm trying to prove that f is measurable.
Any help to get started would be appreciated.
(Also, I tried to make the relevant equation to the problem the title, but it didn't fit; if anyone knows a better way to express the exact problem that does fit in the space allotted for titles, please edit it in)