If $\int_a^bg(x)dx=0$, show that $\int_a^bf(x)g(x)dx=0.$

I try to prove this without invoking anything about Lebesgue integral. Moreover, I do not assume the fact that $fg$ is Riemann integrable nor the inequality $| \int_a^b f(x)g(x) dx | \leq \int_a^b |f(x)g(x)|dx$.

$f$ is Riemann integrable $\Rightarrow$ $f$ is bounded. Choose $M>0$ such that $|f(x)|\leq M$ for all $x\in[a,b]$. Let $\varepsilon>0$ be given. Choose $\delta>0$ such that for any partition $\mathbb{P}=\{x_{0},x_{1},\ldots,x_{n}\}$ of $[a,b]$ (with $a=x_{0}<x_{1}<\ldots<x_{n}=b$) and any $\xi_{i}\in[x_{i-1},x_{i}]$, if $||\mathbb{P}||<\delta$ (here, $||\mathbb{P}||=\max_{1\leq i\leq n}|x_{i}-x_{i-1}|$), then $$ \left|\sum_{i=1}^{n}g(\xi_{i})(x_{i}-x_{i-1})-\int_{a}^{b}g(x)dx\right|<\frac{\varepsilon}{M}. $$ That is, $$ \left|\sum_{i=1}^{n}g(\xi_{i})(x_{i}-x_{i-1})\right|<\frac{\varepsilon}{M}. $$

Now, let $\mathbb{P}=\{x_{0},x_{1},\ldots,x_{n}\}$ be an arbitrary partition of $[a,b]$, with $a=x_{0}<x_{1}<\ldots<x_{n}=b$, that satisfies $||\mathbb{P}||<\delta$. Let $\xi_{i}\in[x_{i-1},x_{i}]$ be arbitrary. Then \begin{eqnarray*} & & \left|\sum_{i=1}^{n}f(\xi_{i})g(\xi_{i})(x_{i}-x_{i-1})-0\right|\\ & \leq & \sum_{i=1}^{n}|f(\xi_{i})g(\xi_{i})|(x_{i}-x_{i-1})\\ & \leq & M\sum_{i=1}^{n}g(\xi_{i})(x_{i}-x_{i-1})\\ & < & M\cdot\frac{\varepsilon}{M}\\ & = & \varepsilon. \end{eqnarray*} This shows that the Riemann integral $\int_{a}^{b}f(x)g(x)dx$ exists and $\int_{a}^{b}f(x)g(x)dx=0$.


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.$$