I received a question on a previous exam, but I had no clue how to go about doing it. I know I'm supposed to use the MVT, IVT and FTC, but I'm not sure where. The question is
Suppose $f(x)$ is integrable on $[a,b]$, with $f(x)\geq0$ on $[a,b]$, and that $g(x)$ is continuous on $[a,b]$. Assuming that $f(x)g(x)$ is integrable on $[a,b]$, show that $\exists c\in[a,b]$ so that $$\int^b_af(x)g(x)dx=g(c)\int^b_af(x)dx.$$
Thank you in advance.
$g(x)$ takes its maximum and minimum values $M$ and $m$ on $[a,b]$. Say, $g(x_1)=M$ and $g_(x_2)=m$. Then $$g(x_1)\int_a^b f(x)\,dx=M\int_a^b f(x)\,dx \ge\int_a^b f(x)g(x)\,dx\ge m\int_a^b f(x)\,dx=g(x_2)\int_a^b f(x)\,dx.$$ Can you now see why there is a $c\in[a,b]$ with $$\int_a^b f(x)g(x)\,dx=g(c)\int_a^b f(x)\,dx?$$