This is not homework.
Let $X$ be a random variable. If $\mathbb{E}[X] = k \in \mathbb{R}$ and $\text{Var}[X] = 0$, does it follow that $\Pr\left(X = k\right) = 1$?
Intuitively, this seems obvious, but I'm not sure how I would prove it. I know for a fact that from the assumptions, it follows that $\mathbb{E}[X^2] = k^2$. So $$\left(\int_{\mathbb{R}}x\text{ d}F(x)\right)^2 = \int_{\mathbb{R}}x^2\text{ d}F(x)\text{.}$$ This doesn't seem to lead me anywhere. I could try $$\text{Var}[X] = \mathbb{E}\left[\left(X - k\right)^2\right]\text{.}$$ Now since $\left(X - k\right)^2 \geq 0$, it follows that $\mathbb{E}\left[\left(X - k\right)^2\right] \geq 0$ as well.
But if I were to use equality, $$\mathbb{E}\left[\left(X - k\right)^2\right] = 0$$ then my gut instinct is that $\left(X - k\right)^2 \equiv 0$, so that $X \equiv k$.
How would I know this? I suppose a proof by contradiction.
If, to the contrary, $X \neq k$ for all $X$, then $(X-k)^2 > 0$, and $\mathbb{E}[(X-k)^2] > 0$ for all $X$. We have a contradiction, so $X \equiv k$.
Is my proof sound -- and if so, is there perhaps a better way to prove this claim?