Improper integral $\int_a^bf(x)dx$ is convergent and $g(x)\ge0$. If $\int_a^bg(x)dx=0$, show that $\int_a^bf(x)g(x)dx=0.$ Assume $f(x)\in\mathrm{C}[a,b),\lim_{x\to b}f(x)=+\infty$, $\int_a^bf(x)dx$ is convergent. And the non-negative function $g(x)$ on the interval $[a,b]$ is Riemann-integrable. If $\int_a^bg(x)dx=0$, show that
$$\int_a^bf(x)g(x)dx=0.$$
Since  $\int_a^bf(x)dx$ is an improper integral, the normal Integral mean value theorem can't work. How can I deal with it? 
 A: Let $c \in (a, b)$. Since $f$ is continuous on $[a ,c]$, the supremum $M = \sup_{[a, c]} |f|$ is finite. Then
$$ \left| \int_{a}^{c} f(x)g(x) \, dx \right|
\leq \int_{a}^{c} |f(x) g(x)| \, dx 
\leq M \int_{a}^{c} g(x) \, dx
= 0 $$
and hence $\int_{a}^{c} f(x) g(x) \, dx = 0$. Therefore $\lim_{c \to b^-} \int_{a}^{c} f(x) g(x) \, dx = 0$ as well.
As you see, improper integrability of $f$ plays no role here. This proof works for arbitrary $f$ that is Riemann integrable on any $[a, c]$ for each $c \in (a, b)$.
(If measure theory is allowed here, then even more general statements are available as other users pointed out.)
A: Hint: $g(x)$ is non-negative on $[a,b]$ and it's integral is zero.
A: In fact $g$ is zero almost everywhere:
For any measurable set $A\subset [a,b)$, we have  $\int_{A}g\le \int_{[a,b)}g=0\ $ (because $g\ge 0).$
so if $A_n=\left \{ x:g(x)\ge 1/n \right \}$ then $A_n\subseteq A_{n+1}.$ Now, define $A:=\bigcup_nA_n =\left \{ x:g(x)\neq 0\right \}.$ 
Then, $0=\int_{A_n}g\ge \frac{1}{n}\lambda(A_n)\Rightarrow \lambda (A_n)=0$ for all integers $n$ and so $\lambda (A)=\lim_n\lambda (A_n)=0.$ Thus $g=0$ almost everywhere. 
