If $\mathbb{E}[X] = k$ and $\text{Var}[X] = 0$, is $\Pr\left(X = k\right) = 1$? 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?
 A: Here is a measure theoretic proof to complement the others, using only definitions. We work on a probability space $(\Omega, \mathcal F, P)$. Notice that $Y:=(X - \mathbb EX)^2 \geq 0$ and consider the integral $\mathbb EY :=\int Y(\omega) P(d\omega)$. Suppose that for some $\epsilon>0$, there  exists $A\in \mathcal F$ such that $Y>\epsilon$ on $A$ and $P(A)>0$. Then $\epsilon I_A$ approximates $Y$ from below, so by the standard definition of $\mathbb E Y$ as the supremum of integrals of simple functions approximating from below,  $$\mathbb EY\geq \int\epsilon I_AP(d\omega) = \epsilon P(A)>0,$$ which is a contradiction. Thus, $\forall \epsilon>0$, $P\left(\{\omega : Y>\epsilon \}\right) = 0$. Done.
A: Prove this by contradiction. By the definition of the variance and your assumptions, you have
$$ 0 =\text{Var}X = \int_\mathbb{R} (x-k)^2\,f(x)\,dx, $$
where $f$ is the probability density of $X$. Note that both $(x-k)^2$ and $f(x)$ are nonnegative.
Now, if $P(X=k)<1$, then
$$U:=\big(\mathbb{R}\setminus\{k\}\big)\cap f^{-1}\big(]0,\infty[\big) $$
has measure greater than zero, and $k\notin U$. But then
$$ \int_U (x-k)^2\,f(x)\,dx > 0,$$
(some $\epsilon$-style argument could be included here) and therefore
$$ 0 =\text{Var}X = \int_\mathbb{R} (x-k)^2\,f(x)\,dx \geq \int_U (x-k)^2\,f(x)\,dx > 0,$$
and your contradiction.
A: What is $X \equiv k$? Is that the same as $X = k$ a.s.?
ETA: Iirc, $X \equiv k \iff X(\omega) = k \ \forall \ \omega \in \Omega \to X=k \ \text{a.s.}$
Anyway, it is obvious that
$$(X-E[X])^2 \ge 0$$
Suppose
$$E[X-E[X])^2] = 0$$
Then
$$(X-E[X])^2 = 0 \ \text{a.s.}$$
The last step I believe involves continuity of probability...or what you did (You are right).

Theres's also Chebyshev's Inequality:
$\forall \epsilon > 0$,
$$P(|X-k| \ge \epsilon) \le \frac{0}{\epsilon^2} = 0$$
$$P(|X-k| \ge \epsilon) = 0$$
$$\to P(|X-k| < \epsilon) = 1$$
Good talking again.

Btw why is it that
$$\int_{\mathbb{R}}x\text{ d}F(x) = \int_{\mathbb{R}}x^2\text{ d}F(x)$$
?
It seems to me that $LHS = k$ while $RHS = k^2$
