Please let me know if I am not confirming to the protocols here. Learning Law of Iterated Expectations is a very slow and long process for me. I know the formulae, but I don't really understand it. Without it Crosssectional and panel data by Wooldridge is taking many, many years to master.
I think finally I am getting it. Please check:
$$Var(Y|X) = E[ (Y - E(Y|X))^2 | X] = E(Y^2|X) - (E(Y|X))^2$$ First equality is definitional. Proof of second equality: Expanding the middle, $$E[ (Y^2 + (E(Y|X))^2 - 2 Y E ((Y|X)) | X )$$ Since conditional expectation is a linear operator $$= E[Y^2|X] + E [ E(Y|X)^2 |X] - 2 E [ Y E(Y|X) |X]$$
Given $X, E(Y|X)^2$ and $E(Y|X)$ are constants, they can be pulled out of outer expectations, OR using $E(Y) = E [ E(Y|X) ] = E[Y^2|X] + (E(Y|X))^2 -2 E(Y|X)$ . $$E(Y|X) = E(Y^2|X) - (E(Y|X))^2$$
I am pretty confident of this, but please let me know if my arguments are incorrect.