Positive integral everywhere implies positive function a.e 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 !

$D$ is certainly measurable. Just replace your strict inequality with $\leq$, and you are good to go.
