This is related to the variance: on one hand, we define , which is (obviously?) nonnegative. On the other hand, you should expand the above expression in order to show that . Since this is nonnegative, you must have , and this is it. So you need to justify why the first expression of is nonnegative, and why it equals the second one.

(There would be another more advanced/general answer involving convexity (and Jensen inequality), but you don't need that. )