# I'm trying to solve the following problem. Let f be an integrable function in (0,1). Suppose th

I'm trying to solve the following problem.
Let $f$ be an integrable function in (0,1). Suppose that
${\int }_{0}^{1}fg\ge 0$
for any non negative, continuous $g:\left(0,1\right)\to \mathbb{R}$. Prove that $f\ge 0$ a.e. in (0,1).
I'm a little unsure on what it is that I must prove in order to conclude that $f\ge 0$. I tried to show that ${\int }_{0}^{1}{f}^{2}\ge 0$ but I couldn't get very far.
I'm seeking hints on how to solve this. Thanks.
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Nirdaciw3
Suppose that $A\subset \left(0,1\right)$ 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\phantom{\rule{thinmathspace}{0ex}}dx<0.$
A logical way to do this would be to choose $g$ such that $g⩾0$ in $A$ and $g=0$ on $\left(0,1\right)\setminus A$. However, since $A$ is only a measurable set, in general $g$ will be discontinuous.
There exists a (relatively) closed set $F\subset A$ such that $|A\setminus F|<ϵ$. Choosing $ϵ=|A|/2>0$, we have that
$|F|=|A|-|A\setminus F|=|A|/2>0.$
Since $|F|>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{array}{rl}{\int }_{0}^{1}fg\phantom{\rule{thinmathspace}{0ex}}dx& ={\int }_{F}fg\phantom{\rule{thinmathspace}{0ex}}dx\\ & ={\int }_{U}f\phantom{\rule{thinmathspace}{0ex}}dx+{\int }_{F\setminus U}fg\phantom{\rule{thinmathspace}{0ex}}dx\\ & ⩽{\int }_{U}f\phantom{\rule{thinmathspace}{0ex}}dx\\ & <0.\end{array}$
This completes the proof.