For continuous $f:[a,b] \to \mathbb{R}$, prove $\exists \ c\in[a,b]$ such that $f(c)=\frac{1}{b-a}\int\limits_{a}^{b}f(x)dx$. Consider a continuous function $f:[a,b]\to \mathbb{R}$. Prove that there exists a $c\in[a,b]$ such that:
$$f(c)=\frac{1}{b-a}\int\limits_{a}^{b}f(x)dx$$
Does this also hold if $f:[a,b]\to \mathbb{R}$ is bounded but continuous only on $(a,b)$?
The first part seems intuitive to me because the $\frac{1}{b-a}\int\limits_{a}^{b}f(x)dx$ (let's call this value $\alpha$) loosely represents the area per unit length, and since $f(x)$ is continuous on $[a,b]$ it must either always be equal to $\alpha$, or at one point lower and at one point higher. Therefore by the intermediate value theorem there exists a $c\in[a,b]$ such that $f(c)=\alpha$. 
For the second part I think the conclusion still holds because integral are not concerned with what happens at single discontinuous points as long as the function is bounded.
So those are my intuitive ideas but I m struggling to make it rigorous (if my ideas are even correct). If anyone could help me with some insight on how to do this I would be ver thankful!
 A: Let $F(x)=\int_a^x f(t)dt$. As $f$ is continuous in $[a,b]$. $F$ is differentiable in $(a,b)$ and by the Mean Value Theorem,
$$\exists c\in (a,b):F'(c)=\frac{F(b)-F(a)}{b-a}\iff f(c)=\frac{\int_a^bf(x)dx}{b-a}$$
For the second, review the hypothesis in the Mean Value Theorem.
A: Let $\,F(x):=\int f(x)\,dx\,$ be a primitive of $\,f(x)\,$ . Then $\,F\,$ is derivable so by the MVT:
$$\frac{1}{b-a}\int\limits_a^bf(x)\,dx=\frac{F(b)-F(a)}{b-a}=F'(c)=f(c)$$
A: Assume $f\colon(a,b)\to \mathbb R$ is continuous, $f(x)<\alpha$ for all $x\in(a,b)$ and $\int_a^b f(x)\,dx$ exists.
Then $\int_a^b f(x)\,dx\le (b-a)\alpha$.
In fact, with $\alpha'=\frac{f(\frac{a+b}2)+\alpha}2$, there is an interval $(c,d)$ around  $\frac{a+b}2$ with $f(x)<\alpha'$ in $(c,d)$. Thus $\int_a^b f(x)\,dx\le (c-a)\alpha+(d-c)\alpha'+(b-d)\alpha<(b-a)\alpha$.
Similarly, $f(x)>\alpha$ for all $x\in(a,b)$ implies $\int_a^b f(x)\,dx>(b-a)\alpha$.
Thus by letting $\alpha =\frac1{b-a}\int_a^b f(x)\,dx$ we know that neither $f(x)<\alpha$ for all $x$ nor $f(x)>\alpha$ for all $x$. If $f(x)\ne\alpha$ for all $x$, we conclude $f(x_1)<\alpha$ for some $x_1$ and $f(x_2)>\alpha$ for some $x_2$, so that IMV can be applied to $[x_1,x_2]$ (resp. $[x_2,x_1]$). 
A: $f\in\mathcal C[a,b]\implies\exists ~c,d\in[a,b]$ such that $f(c)=\inf_{x\in[a,b]}f(x),~f(d)=\sup_{x\in[a,b]}f(x).$
Clearly then, 
$f(c)(b-a)\leq\int_a^b f(x)dx\leq f(d)(b-a)$
i.e. $ f(c)\leq\dfrac{1}{b-a}\int_a^b f(x)dx\leq f(d).$ 
Now use the intermediate value theorem.
