TITLE: If $\int_a^bg(x)dx=0$, show that $\int_a^bf(x)g(x)dx=0.$
QUESTION [8 upvotes]: Let $g(x)\ge0$. If $\int_a^bg(x)dx=0$, show that $\int_a^bf(x)g(x)dx=0,$ where $f$ is any integrable function.
If simeone is allowed to use the Mean Value thorem for integrals, the proof is at hand. But for that $f$ must be continuous!
Any suggestion?

REPLY [6 votes]: This is about Riemann integration, so $f,g$ are necessarily bounded. 
We'll use that. 
$$\int_a^b f g dx =\int_a^b \underset{\mbox{nonnegative}}{\underbrace{(f - \inf f)}} g dx+ (\inf f )\underset{=0}{\underbrace{\int_a^b  g dx}} $$ 
so the problem is reduced to Riemann integrable nonnegative $f$. For such $f$
$$ 0\le \int_a^b g f dx \le (\sup f) \int_a^b g dx =0.$$