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)\ge 0$ 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 $\mathrm{\exists}c\in [a,b]$ so that

${\int}_{a}^{b}f(x)g(x)dx=g(c){\int}_{a}^{b}f(x)dx.$

Thank you in advance.

Suppose $f(x)$ is integrable on $[a,b]$, with $f(x)\ge 0$ 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 $\mathrm{\exists}c\in [a,b]$ so that

${\int}_{a}^{b}f(x)g(x)dx=g(c){\int}_{a}^{b}f(x)dx.$

Thank you in advance.