$\int_0^1 fg\geq 0$ for every non negative, continuous $g$ implies $f\geq 0$ a.e.

continuityintegrationlebesgue-integralmeasure-theoryreal-analysis

I'm trying to solve the following problem.

Let $f$ be an integrable function in $(0,1)$. Suppose that $$\int_0^1fg\geq0$$

for any non negative, continuous $g:(0,1)\to\mathbb{R}$. Prove that $f\geq0$ a.e. in $(0,1)$.

I'm a little unsure on what it is that I must prove in order to conclude that $f\geq0$. I tried to show that $\int_0^1f^2\geq0$ but I couldn't get very far.

I'm seeking hints on how to solve this. Thanks.

Best Answer

Suppose that $A \subset (0,1)$ is measurable, is of positive measure and $f<0$ on $A$. The idea is that we want to construct a continuous function $g$ such that $$\int_0^1 fg\, dx<0. $$ A logical way to do this would be to choose $g$ such that $g\geqslant 0$ in $A$ and $g=0$ on $(0,1) \setminus A$. However, since $A$ is only a measurable set, in general $g$ will be discontinuous.

The way to get around this is to use the result I mentioned in the comments. A direct corollary of this result is that, given $\varepsilon >0$, there exists a (relatively) closed set $F \subset A$ such that $\vert A \setminus F \vert <\epsilon$. Choosing $\epsilon = \vert A \vert /2 >0$, we have that $$\vert F \vert=\vert A \vert - \vert A \setminus F\vert= \vert A \vert /2 >0.$$ Since $\vert F \vert >0$, the interior of $F$ is nonempty. Thus, there exists an open set $U$ compactly contained in the interior of $ F$ (just take a small ball for example). Define $g$ such that $g$ is continuous, nonnegative, $g=0$ in $A\setminus F$, and $g=1$ in $U$. Then \begin{align*} \int_0^1 fg \, dx &=\int_F fg \, dx \\ &=\int_U f \, dx + \int_{F\setminus U} fg \, dx \\ &\leqslant \int_U f \, dx \\&<0. \end{align*} This completes the proof.

Related Question