Let $f$ be integrable on $[a,b]$ and suppose for each integrable function $g$ defined on $[a,b]$, $\int^{b}_afg=0$, then $f(x)=0,\forall x\in[a,b]$

Here is a counterexample using Lebesgue integration.

Let $f=\chi_{\Bbb Q\cap [a,b]}$. Then $f$ is $0$ a.e. , hence Lebesgue integrable. Next for any Lebesgue integrable $g$ we have $fg=0$ a.e. so that $fg$ is Lebesgue integrable and $\int_a^b fg=0$ . But $f$ is not identically zero in $[a,b]$.


The conclusion should by $f(x)=0$ almost everywhere. To prove, set $g$ equals the sign of $f$ times $f$, which is integrable and $fg=|f|$. Then you get that $\int|f(x)|dx=0$, which implies that $f=0$ almost everywhere.


Okay since this is true for every integrable function g, take $g=f$

Now this becomes $\int^{b}_aff=0$

Now we know that $f^2(x)\geq0$

and $\int^{b}_af^2(x)=0$, This means that the area of the curve is zero even if the function is always above x axis, only one conclusion can be derived from this, that is

$f^2(x) \equiv 0$ $\forall$ x $\in$ $(a,b)$

The function becomes identically zero.

therefore $f(x)=0,\forall x\in[a,b]$

EDIT: If it is given that f(x) and g(x) is continuous functions then this approach would work, since there is no such condition in this question, hence the statement becomes false.