There is a question about EPE at StackExchange where next expresion is indicated:
$$\mathbb{E}[(Y-f(X))^2]=\mathbb{E}[(Y-\mathbb{E}[Y|X])^2]+\mathbb{E}[(\mathbb{E}[Y|X]-f(X))^2]$$
I don't understand this. Anybody could explain me why $$\mathbb{E}[(Y-f(X))^2]$$ is equal to $$\mathbb{E}[(Y-\mathbb{E}[Y|X])^2]+\mathbb{E}[(\mathbb{E}[Y|X]-f(X))^2]$$ ?
Thanks.