"Mean Value Theorem" for a integrable and bounded function There is a formula that reminds the Mean Value Theorem in integral form for a function that is only integrable and bounded, not continuous. That is: If $f$ is integrable in $[a,b]$ and $m\leq f(x) \leq M$ for all $x$ in $[a,b]$, then: $${\int_{a}^{b}f(x)dx = \mu (b-a)}$$ where $m\leq \mu \leq M$. 
This is what I've done so far:
If $F:[a,b] \rightarrow \mathbb{R}$ is a primitive of $f$ and $P$ is a partition of $[a,b]$, then: $${\int_{a}^{b}f(x)dx = F(b) - F(a) = \sum_{i=1}^n[F(t_i) - F(t_{i-1})].}$$ Using the fact that $F$ has derivative, it follows that the Mean Value Theorem applies: there exist, for each subinterval $[t_{i-1},t_i]$, a $c_i \in (t_{i-1},t_i)$ such that: $${F(t_i) - F(t_{i-1}) = F'(c_i)(t_i - t_{i-1})}$$ for all $i$. Then my guess is that I would use the inequality: $${m(b-a) \leq \int_{a}^{b}f(x)dx \leq M(b-a)}$$ where $m$ and $M$ are the "inf" and "sup" of $f$, respectively, but from here I am stuck. 
 A: For any partition $a = x_0 < x_1 < \dots < x_n = b$, the Riemann sum
$$
\Sigma_{i=0}^{n-1} f(\tilde x_i) (x_{i+1} - x_i)
$$
where each $\tilde x_i \in [x_i, x_{x+1}]$, is bounded below by $m (b-a)$ and above by $M (b-a)$. For example, 
$$
\begin{align}
m (b-a) &= m \Sigma_{i=0}^{n-1} (x_{i+1} - x_i) \\
&= \Sigma_{i=0}^{n-1} m (x_{i+1} - x_i) \\
&\le \Sigma_{i=0}^{n-1} f(\tilde x_i) (x_{i+1} - x_i) \\
\end{align}
$$
and similarly for $M$.
So the integral, the limit of the Riemann sums, is between these same bounds:
$$
m (b-a) \le \int^b_a f(x) dx \le M (b-a) \text{.}
$$
Now, $x \mapsto x (b-a) \colon [m, M] \to \mathbb{R}$ is continuous, so by the intermediate value theorem there's some $\mu \in [m, M]$ where
$$
\mu (b-a) = \int^b_a f(x) dx
$$
A: We want to prove the following:

If $f$ is integrable in $[a,b]$ and $m\leq f(x) \leq M$ for all $x$ in $[a,b]$, then: $${\int_{a}^{b}f(x)dx = \mu (b-a)}$$ where $m\leq \mu \leq M$. 

Although this is somewhat reminiscent of a mean value theorem for integrals, it's much simpler. Call
$$ \int_a^b f(x) dx = I,$$
which exists since $f$ is integrable. It is very easy to show that $m(b-a) \leq  I \leq M(b-a)$, and I take this for granted.
Then you can consider a function $g(x) = I - x(b-a)$ on the interval $[m,M]$. Now $g$ is a continuous function. We know $g(m) \geq 0$ and $g(M) \leq 0$, so by the intermediate value theorem there is some $\mu \in [m,M]$ such that $I - \mu(b-a) = 0$, or rather $I = \mu(b-a)$. $\diamondsuit$
The strength of the usual integral mean value theorem is that there is some $c$ so that the integral is given by $f(c)(b-a)$, in particular that it's given by a particular value of $f$.
We cannot hope to prove quite the same thing here. For instance, consider the function given by $0$ from $0$ to $1$ and $2$ from $1$ to $2$. Then the average value is $1$, which is not a value taken by the function.
