A nonnegative random variable has zero expectation if and only if it is zero almost surely Let $Y$ be a non-negative random variable. Prove that $E(Y) = 0$ if and only if $P(Y=0)=1$.
My understanding is that while you can prove it for discrete $Y$, the result is true for all $Y$.

Sufficiency is obvious. For necessity, assume for contradiction that $E[Y] = 0$ and $P(Y > 0) = c > 0$. From total expectation, we have:
$$
0 = E[Y] \ge P(Y>0)E[Y\mid Y >0] = cE[Y \mid Y>0] > 0.
$$
