How can I prove $\mathbb{E}[(X - bY)^{2}]$ is minimized at $b = 1$ for random variables $X$ and $Z$, where $Y = \mathbb{E}[{X \mid Z}]$?
I saw a similar example, so here's my approach:
$$\mathbb{E}[(X - bY)^{2}] = \mathbb{E}[X^{2} - 2bXY + b^{2}Y^{2}]$$
$$= b^{2}\mathbb{E}[Y^{2}] - 2b\mathbb{E}[XY] + \mathbb{E}[X^{2}].$$
Think of this as a polynomial in $b$. Since a polynomial of the form $f(x) = ax^{2} + bx + c$ with $a > 0$ has minimum at $-b/2a$, and our expression above has its leading coefficient positive, we know that the minimum is at
$$\frac{2\mathbb{E}[XY]}{2\mathbb{E}[Y^{2}]} = \frac{\mathbb{E}[X \cdot \mathbb{E}[X \mid Z]]}{\mathbb{E}[(\mathbb{E}[X \mid Z])^{2}]}. $$
Now I just need to show that this fraction is equal to $1$. I tried to do conditioning, but it didn't help. Any suggestions