If $\mathbb E(X)=\mathbb E\left(X^2\right)=0$ show that $\mathbb P(X=0)=1$ Can anyone help me with this problem?

I want to show that if $\mathbb E(X)=\mathbb E\left(X^2\right)=0$ then $\mathbb P(X=0)=1$.

I was thinking to use Markov's inequality as this:
$\mathbb P\left(X&lt;\dfrac1n\right)\le\dfrac{\mathbb E(X)}{1/n}=0$ so, $\mathbb P(X=0)=1$.

I am not sure.
You don't need to use Markov inequality. If $\mathbb{E}[X^2] = 0$, you must have $$\int_{x}x^2 f(x) dx = 0$$ As $x^2$ is always non-negative, it cannot be the case that $f(x) &gt; 0$ and $x^2 &gt; 0$ simultaneously, so for all $x^2 &gt; 0$ we must have $f(x) = 0$. This, in turn, means $\mathbb{P}[X^2 &gt; 0] = 0 \implies \mathbb{P}[X^2 = 0] = 1 \implies \mathbb{P}[X = 0] = 1$.
You don't need to use Markov inequality. If $\mathbb{E}[X^2] = 0$, you must have $$\int_{x}x^2 f(x) dx = 0$$ As $x^2$ is always non-negative, it cannot be the case that $f(x) &gt; 0$ and $x^2 &gt; 0$ simultaneously, so for all $x^2 &gt; 0$ we must have $f(x) = 0$. This, in turn, means $\mathbb{P}[X^2 &gt; 0] = 0 \implies \mathbb{P}[X^2 = 0] = 1 \implies \mathbb{P}[X = 0] = 1$.