Solution (source code)

= Solution

<Cauchy-Schwarz inequality> applied to $X1_{X\gt 0}$ gives $(\mathbb EX)^2\le\mathbb E(X^2)\mathbb P(X\gt 0)$.