In this post some basic steps were given as understood, and I've been trying to fill in the gaps without much success. Specifically, the problem calls for random variables $X,$ $Y,$ and $U,$ linked by the formula
$$U = Y - E[Y\vert X]$$
and the exercise calls for demonstrating that $U$ is uncorrelated with $X.$
I am stuck at the first step in the comments to the post:
Compute $E(U|X)$ and then $E(U).$ Repeat with $E(UX|X).$ What happens?
The person asking the question quickly comes back with $E(U\vert X)=0.$
I can see that linearity would allow $E[U] = E[Y] - E[E[Y\vert X]]=E[Y]-E[Y]=0,$ but all the searches I have done on conditional expectation entail either summations of PMFs or integrations of PDFs.
How can I calculate $E(U\vert X)$ and $E(UX\vert X)$ from the information given in the exercise?
Compute first $$ E(U|X) = E((Y - E(Y|X))|X) = E(Y|X) - E(E(Y|X)|X) = E(Y|X) - E(Y|X) = 0 $$ Here I have used linearity of the conditional expectation and the fact that $E(E(Y|X)|X) = E(Y|X)$, i.e. the conditional expectation acts as a projection. Repeated conditioning does not change anything.
It follows that $E(U) = E(E(U|X)) = 0$.
Next $$ E(UX|X) = X \cdot E(U|X) = 0 \,. $$ Here the general formula $E(g(X)Y|X) = g(X)E(Y|X)$ was also used. Terms that depend only on the conditioning r.v. $X$ may be treated as constants.
Therefore also $E(UX) = 0$. Consequently $E(UX) = 0 = E(U)E(X)$ and this implies that $U$ and $X$ are uncorrelated.