Consider the function $h(x) = f(x)*(g(b) - g(a)) - g(x)*(f(b) - f(a))$ on $[a, b]$. Then:
$$
h(a) = f(a)g(b) - f(a)g(a) - g(a)f(b) + g(a)f(a) = f(a)g(b) - f(b)g(a),
$$
and
$$
h(b) = f(b)*(g(b) - g(a)) - g(b)*(f(b) - f(a)) = f(a)g(b) - f(b)g(a).
$$
We see that $h(a) = h(b)$, so by Rolle's theorem: there is a $c \in (a, b)$ such that $h'(c) = 0$. So:
$$
f'(c)*(g(b) - g(a)) - g'(c)*(f(b) - f(a)) = 0 ,
$$
and we have:
$$
\frac{f'(c)}{g'(c)} = \frac{f(b) - f(a)}{g(b) - g(a)}.
$$
Observe that if $g \equiv 0$, then the result holds. Thus, we'll take $g \not \equiv 0$. Since $f$ is continuous on the closed interval $[a,b]$, it must attain a minimum and maximum, so we'll say there exists $m \leq f(x) \leq M$ for all $x \in [a,b]$. Then, since $g$ is nonnegative on $[a,b]$, we have
$$ mg(x) \leq f(x)g(x) \leq Mg(x) $$
Integrating all three sides yields
$$ m \int_a^b g(x)\, dx \leq \int_a^b f(x)g(x) \, dx \leq M \int_a^b g(x) \, dx $$
Under the assumption that $g \not \equiv 0$, we may divide all three sides by $\int_a^b g(x) \, dx$, yielding
$$ m \leq \frac{\int_a^b f(x) g(x) \, dx}{\int_a^b g(x) \, dx} \leq M $$
Recalling that $f$ is continuous, we invoke the Intermediate Value Theorem to deduce that there exists $c \in [a,b]$ such that
$$ f(c) = \frac{\int_a^b f(x) g(x) \, dx}{\int_a^b g(x) \, dx} \quad \implies \quad \int_a^b f(x) g(x) \, dx = f(c) \int_a^b g(x) \, dx$$
Therefore, the result holds.
Best Answer
Let $f:[a,b]\rightarrow \mathbb{R}$ be continuous. By the extreme value theorem there exist $x_{m},x_{M} \in [a,b]$ such that $f(x_m)=m:= \inf_{x\in [a,b]}f(x)$ and $f(x_M)=M:=\sup_{x\in [a,b]}f(x)$. Now clearly $$f(x_m)(b-a)=\int_a^b m \: dx \leq \int_a^b f(x) \: dx \leq \int_a^b M \: dx = f(x_M)(b-a).$$ From here the intermediate value theorem ensures the existence of a $\xi$ between $x_m$ and $x_M$, such that $$f(\xi)=\frac{1}{b-a} \int_a^b f(x) \: dx$$