How can I prove that $\Bbb{P}(X>0)\geq \frac{\Bbb{E}(X)^2}{\Bbb{E}(X^2)}$ I have the following problem:

Let $X$ be a nonnegative random variable such that $\Bbb{E}(X^2)<\infty$ Then show that $$\Bbb{P}(X>0)\geq \frac{\Bbb{E}(X)^2}{\Bbb{E}(X^2)}$$

I would like to get some hints, because I did the following:
Let me define $U:=X$ and $V:=\Bbb{1}_{\{X>0\}}$. Then clearly $U\in L^2$. But also $V\in L^2$ since $$\int_\Omega (\Bbb{1}_{\{X>0\}})^2 \Bbb{P}(d\omega)=\int_\Omega \Bbb{1}_{\{X>0\}}\Bbb{P}(d\omega)=\Bbb{P}(X>0)\leq 1$$In addition we have that $\Bbb{E}(V^2)=\Bbb{E}((\Bbb{1}_{\{X>0\}})^2)=\Bbb{E}(\Bbb{1}_{\{X>0\}})=\Bbb{P}(X>0)$. Now applying the Cauchy-Schwarz inequality we get $\Bbb{E}(|UV|)^2\leq \Bbb{E}(U^2)\cdot\Bbb{E}(V^2)=\Bbb{E}(U^2)\cdot\Bbb{P}(X>0)$ so $$\Bbb{P}(X>0)\geq \frac{\Bbb{E}(|\Bbb{1}_{\{X>0\}}X|)^2}{\Bbb{E}(X^2)}$$
Now I see that $\Bbb{E}(|\Bbb{1}_{\{X>0\}}X|)=\Bbb{E}(\Bbb{1}_{\{X>0\}}X)=\Bbb{E}(X)$ since the lebesgue mesure doesn't see the nullsets.
Is this correct like this?
Thanks for your help.
 A: From Cauchy-Schwarz inequality:
$\Bbb{E}(X)=\Bbb{E}(1_{\{X>0\}}X)\leq \sqrt{\Bbb{E}(1_{\{X>0\}}^2)}\cdot \sqrt{\Bbb{E}(X^2)} = \sqrt{P(X>0)}\cdot \sqrt{\Bbb{E}(X^2)}$. Therefore
$\Bbb{E}(X)^2 \leq P(X>0)\cdot \Bbb{E}(X^2)$
A: Yes. Just to mention that it would also be true if we only had $\mathbb E[X]\ge0$. Indeed, since $\mathbb E[X]\le\mathbb E[X1_{\{X>0\}}]$, you could just square the inequality and prove the claim.
A: Everything about your proof is correct, except for the final line "since the lebesgue mesure doesn't see the nullsets." This is only true for continuous variables, but your problem doesn't mention that $X$ must be continuous. If $X$ is discrete, so for example if $X$ a coin flip $P(X=0)=P(X=1)=\frac{1}{2}$, it does not hold that $\Bbb{E}[\Bbb{1}_{\{X\neq 1\}}X]=\Bbb{E}[X]$, even though the set $\{1\}$ is a null-set for the Lebesgue measure.
The reason why it is correct that $\Bbb{E}[\Bbb{1}_{\{X>0 \}}X]=\Bbb{E}[X]$ is actually much simpler, and it is that $\Bbb{1}_{\{X>0 \}}X=X$. They are the same random variable since if $\Bbb{1}_{\{X>0 \}}=0$, then $X$ is already $0$.
In general, for any random variable $X$ (discrete or continuous) $\Bbb{1}_{\{X\neq 0 \}}X=X$.
This is not true in general: $\Bbb{1}_{\{X\neq a \}}X\neq X$ for $a\neq 0$. See for example the coin flip $\Bbb{1}_{\{X\neq 1\}}X\neq X$.
