I try to minimize mean squared error function defined as:
$E\left[Y - f(X)\right]^2$
I summarized the minimization procedure from different online sources (e.g., URL 1 (p. 4), URL 2 (p. 8)) in the following lines.
First add and subtract $E[Y | X]$:
$E\left[\left\lbrace(Y - E[Y | X]) - (f(X) - E[Y|X])\right\rbrace^2\right]$
Expanding the quadratic yield:
$E\left[\left(Y - E[Y|X]\right)^2 + \left(f(X) - E[Y|X]\right)^2 - 2 \left(Y - E[Y|X]\right)\left(f(X) - E[Y|X]\right)\right]$
First term is not affected by the choice of $f(X)$; third term is $0$, so the whole expression is minimized if $f(X) = E(Y|X)$.
Question 1: I wonder what is the motivation to add and subtract $E[Y | X]$ in the first step of the procedure?
Question 2: How to explain in plain English why third term in quadratic is $0$?