First mean value theorem for integrals 
Hello! The above picture is an excerpt from Zorich's book. I was able to solve part a) but do not know how to attack part b).
Parts a) and b) are very similar to  the theorem from this book which I'll attach below. In this theorem in part a) the infimum and supremum are taken over open interval $(a,b)$. In part b) if we take $g(x)\equiv 1$ then there is a point $\xi$ belongs to $[a,b]$ but in our problem this point should in $(a,b)$.
I guess part b) can be deduced somehow from part a) but I do not know how to do it. I'd be very thankful for any help!


By basic properties of integrals, we have
$$
m\leq \dfrac{1}{b-a}\int_a^b f(x)\, dx \leq M.
$$
On the other hand, by continuity of $f$ on $[a,b]$, there exist $x_m, x_M\in [a,b]$ such that $f(x_m)=m$ and $f(x_M)=M$. Therefore
\begin{equation}\tag{1}
f(x_m)\leq \dfrac{1}{b-a}\int_a^b f(x)\, dx \leq f(x_M).
\end{equation}
If $m=M$ then $f$ is constant and so any $\xi\in ]a,b[$ will do, so we assume $m<M$. In this case we can see that both inequalities in (1) are strict (for instance consider $f(x)-m\geq 0$, and if the integral of this is zero then $f\equiv m$ which is a contradiction). Assume that $x_m<x_M$ (if the opposite is true change the interval $]x_m, x_M[$ for $]x_M,x_m[$ below), then by the intermediate value theorem, and (1) with the strict inequalities, there exists $\xi\in ]x_m,x_M[$ such that
$$
f(\xi)= \frac{1}{b-a}\int_a^b f(x)\, dx.
$$
This is what you want.
