In our lecture, we have proven that $\mathbb E[(X-\mathbb E[X])^2]=\mathbb E[X^2]-\mathbb E[X]^2$ (*)
then we go on say if $\operatorname{Var}(X)=0$ it follows using (*) that:
$\mathbb P((X-\mathbb E[X])^2=0)=1$ and therefore $\mathbb P(X=\mathbb E[X])=1$
I have seen other proofs via contradiction to prove $\mathbb P(X=\mathbb E[X])=1$ but all have been without the use of (*). As my professor makes direct reference to $\mathbb E[(X-\mathbb E[X])^2]=\mathbb E[X^2]-\mathbb E[X]^2$, I assume it should be somewhat easier. Nonetheless, I do not understand how it becomes simpler. Any help is greatly appreciated
The proof uses the following fact. Namely, if $EY=0$ where $Y\geq 0$, then $Y=0$ with probability one. Indeed by markov's inequality $P(Y> 1/n)\leq nEY=0$ so whence by measure continuity $P(Y>0)=\lim_{n\to \infty}P(Y>1/n)=0$. Thus $P(Y=0)=1$.
In your proof use the above fact with $Y=(X-EX)^2$. Then we have that $(X-EX)^2=0$ with probability one i.e. $X=EX$ with probability one.