> 
> Suppose $f : [a,b] \to \mathbb{R}$ is continuous and $g \in \mathcal{R}[a,b]$ with $g(x) \ge 0$ for all $x \in [a,b]$. Show that there exists a $c \in [a,b]$ such that $$\int\_a^b f(x)g(x) \, dx = f(c) \int\_a^b g(x) \, dx.$$
> 
> 
> 

My attempt:

My class proved a theorem which states that $f$ attains its minimum and maximum ($m$ and $M$, respectively), since $f$ is continuous on a closed interval like $[a,b]$. So we would have $m \le f(x) \le M$. Multiplying both sides by $g$ and integrating, we get $$m \int\_a^b g(x) \, dx \le \int\_a^b f(x) g(x) \, dx \le M \int\_a^b g(x) \, dx.$$

I am stuck after this. Where can I go from here?