I found that the following result has been used extensively in my lecture note of martingale. Could you please verify if my proof is correct or contains logical mistake? Many thanks!
Let $(\Omega, \mathcal{A}, \mathbb P)$ be a probability space and $X:\Omega \to \mathbb R$ be a random variable. Then $$X \ge 0 \quad \text{a.s} \iff \forall \Lambda \in \mathcal A: \mathbb E (\mathbf{1}_\Lambda X) \ge 0$$
My attempt:
$\Longrightarrow$ Because $X \ge 0$ a.s, $\mathbf{1}_\Lambda X \ge 0$ a.s. The claim then follows.
$\Longleftarrow$ Assume the contrary that there exists $\Lambda \in \mathcal A$ such that $\mu (\Lambda) >0$ and $X(\omega) <0$ for all $\omega \in \Lambda$. Then $\mathbb E (\mathbf{1}_\Lambda X) = \int_\Omega \mathbf{1}_\Lambda X \, d \mu <0$, which is impossible.
The only gap is the proof of last strict inequality: $\mu(\Lambda)>0$ and $X(\omega)<0$ for all $\omega \in \Lambda$ implies $\mathbb E (\mathbf{1}_\Lambda X) = \int_\Lambda X \, d \mu <0$.
If you will prove it rigorously, you need in smth like that: let $\mu(\Lambda)>0$, then there exists $n$ such that the set $\Lambda_n=\{\omega: X(\omega)\leq -\frac1n\}$ has $\mu(\Lambda_n)>0$, then $$ \mathbb E (\mathbf{1}_{\Lambda_n} X) = \int_{\Lambda_n} X \, d \mu \leq \int_{\Lambda_n} -\frac1n \, d \mu = -\frac{\mu(\Lambda_n)}n <0 $$ which is impossible. So we get contradiction with assumption...
I prefer here the direct proof to the proof from the contrary. Prove that for $\Lambda=\{\omega:X(\omega)<0\}$ we have $\mu(\Lambda)=0$.
Define $\Lambda_n = \{\omega: X(\omega)\leq -\frac1n\}$. Then $$ 0\leq \mathbb E (\mathbf{1}_{\Lambda_n} X) = \int_{\Lambda_n} X \, d \mu \leq \int_{\Lambda_n} -\frac1n \, d \mu = -\frac{\mu(\Lambda_n)}n\leq 0 $$ which follows $\mu(\Lambda_n)=0$ for all $n$.
Take $\bigcup\limits_{n=1}^\infty \Lambda_n=\Lambda=\{\omega: X(\omega)<0\}$. Note that $\Lambda_n\subset \Lambda_{n+1}$, so continuity from below of measure $\mu$ gives that $$ \mu(\Lambda) = \lim_{n\to\infty} \mu(\Lambda_n) = \lim_{n\to\infty} 0 = 0. $$