$X_1,X_2$ are two r.v. when $f_{X_1}(x_1)>0$,define the conditional pdf $$f_{X_2|X_1}(x_2|x_1)=\frac{f_{X_1,X_2}(x_1,x_2)}{f_{X_1}(x_1)}$$ then $$\mathbb P(A|X_1=x_1)=\int_Af_{X_2|X_1}(x_2|x_1)\,dx_2$$ is a probability measure
then we can define $$\mathbb E\left[u(X_2)|x_1\right]=\int_\mathbb{R}u(x_2)f_{X_2|X_1}(x_2|x_1)\,dx_2=g(x_1)$$
at last we can conclude that $\mathbb E\left[u(X_2)|X_1\right]=g(X_1)$
My question is how to get $$\mathbb E\left[u(X_2)|X_2\right]=u(X_2)$$ using the reason above?
I found it hard to determine $f_{X_2,X_2}(x_1,x_2)$.