[Math] Positive integral everywhere implies positive function a.e

inequalityintegrationmeasure-theory

I would like to get feedback on my demonstration of this simple statement :

Let $f$ be an integrable function on the measure space $(X,S,\mu)$.

\begin{align}
\text{If }\int_E f \, d\mu \geq 0\text{ for all }E\in S\text{ then }f \geq 0\text{ a.e.}
\end{align}

I came up with this and I'm not sure about the reasoning …

Let $D = \{x: f(x)<0\}$ be the set where $f$ is negative. Since $f$ is integrable we have :
$$\int_Df < \int_D 0 = 0$$
But for all $E\in S$ we have $\int_E f\geq 0$. So by taking $E=D$ we have :
$$0 \leq \int_Df < 0. $$ Which is impossible. So the set $D$ must not be measurable.

I would think that I have to find a way to show that $\mu(D) = 0$ to conclude that $f \geq 0$ a.e

Thanks for any help !

Best Answer

I think it much more convincing to note that $\{f < 0\} = \cup_{n=1}^\infty \{f \leq -n^{-1}\}$. Suppose that $\alpha_n = \mu(\{f \leq -n^{-1}\}) > 0$ for some $n \geq 1$; then $$\int_{\{f \leq -n^{-1}\}} f d\mu \leq -n^{-1}\alpha_n < 0,$$ a contradiction to the hypothesis since $f^{-1}(-\infty,-n^{-1})$ is the pre-image of a Borel set, hence measurable. Thus $\alpha_n = 0$ for all $n \geq 1$, and $$\mu(\{f < 0\}) \leq \sum_{n=1}^\infty \alpha_n = 0.$$

Related Question