Question about condtion of MVT for integral. For $f \in C[a,b], g\ge0$ (or $g\le0$) on $[a,b]$, then there exists $c\in(a,b)$ $\int _a^b f(x)g(x)dx = f(c)\int_a^bg(x)dx$. 
It is MVT for integral.
Why $c \in (a,b)$ ? How about $c\in[a,b]$? Is it wrong?
I am wondering this because, in proving progress, 
by IVT, there exist $m,M$ s.t $m\le f(x)\le M$ 
so $m\int_a^bg(x)dx$ $\le$ $\int_a^b f(x)g(x)dx$ $\le$ $M\int_a^bg(x)dx$.
when $\int_a^bg(x)dx>0$ then $m\le$ $\frac{\int_a^b f(x)g(x)dx} {\int_a^bg(x)dx}$   $\le$  $M$ and 
$\frac{\int_a^b f(x)g(x)dx} {\int_a^bg(x)dx}$ becomes $f(c)$, so it seems $c\in [a,b]$ might work.
So, I want to know why $c\in(a,b)$, or $c\in[a,b] $ would be okay.

In the book Mathematical Analysis I by Vladimir A. Zorich (p. 352) I found:

As far as I can tell from the proof in the book, the proof depends on the intermediate value theorem, which states 

But $c \in (a,b)$, since if either $f(a) = 0$ or $f(b) = 0$ would imply $f(a)f(b) = 0$ and so the function would not fulfill the hypothesis of the intermediate value theorem. Thus in fact it is $c \in (a,b)$, but $(a,b) \subseteq [a,b]$. Hence we can use $[a,b]$.
