Equivalence of the Sup/Inf Definition of the Integral If $f:[a,b]\to \mathbb{R}$ is integrable prove that 
$$\int_a^b f(x) dx = \sup\left\{ \int_a^b g(x) dx : g \text{ is continuous and } g \leq  f \right\} $$ $$ =  \inf\left\{ \int_a^b h(x) dx : h \text{ is continuous and } f \leq h \right\}.$$
Something just doesn't add up when I try to prove this. Please help.
Sorry if this is written badly. This is my first post.
Thank you.
 A: Here is the definition of integral on an interval that I use in this answer. The integral of a piecewise-constant function over an interval is very easy to find: just integrate each constant piece and add the integrals. Given real values $a$ and $b$ and a bounded function $f(x)$ defined on $[a,b]$, we define
$$S_L=\sup\left\{ \int_a^b p(x)\,dx \mid p(x)\text{ is piecewise-constant and $p(x)\le f(x)$ for $a\le x\le b$ } \right\}$$
$$S_U=\inf\left\{ \int_a^b q(x)\,dx \mid q(x)\text{ is piecewise-constant and $q(x)\ge f(x)$ for $a\le x\le b$ } \right\}$$
Then $\int_a^b f(x)\,dx$ is defined if and only if $S_L=S_U$, and it equals that common value.
Here is a graph of an integrable but non-continuous function $f(x)$, shown in solid black. A piecewise-constant function $p(x)\le f(x)$ is shown in solid blue and piecewise-constant function $q(x)\ge f(x)$ is shown in solid red.

We can make a continuous function $g(x)$, shown in dashed cyan, that closely approximates $p(x)$ and is below it: $g(x)$ equals $p(x)$ except for a small area near endpoints. We can
make the integral of $g(x)$ as close as we like to the integral of $p(x)$.
The supremum of the integrals of the continuous $g(x)$'s equals the integral of $p(x)$, and the supremum of the integrals of the $p(x)$'s equals the integral of $f(x)$. Therefore, the supremum of the integrals of the continuous $g(x)$'s equals the integral of $f(x)$, as we wanted.
We can do the same with $h(x)$'s, shown in dashed orange, above $q(x)$ to get the other part of your problem. I left out a few steps, but this should give you the intuition and overview of the proof that you want.
