Let $X,Y,Z$ be real valued random variables such that $(X,Z)=(Y,Z)$ in law. Let $g$ be a bounded Borel function and define $h_1(X)=\mathbb{E}(g(Z)|X),h_2(Y)=\mathbb{E}(g(Z)|Y)$. Prove that $h_1(Y)=h_2(Y)$ a.s.
I'm able to prove that if I also suppose that the random variables are jointly absolutely continuous:
$$h_1(x)=\int g(z)f_{(Z|X)}(z,x)dz=\int g(z)\frac{f_{(Z,X)}(z,x)}{\int f_{(Z,X)}(z',x)dz'}dz\\=\int g(z)\frac{f_{(Z,Y)}(z,x)}{\int f_{(Z,Y)}(z',x)dz'}dz=h_2(x)$$
Can someone help me?
We note that, if $(X, Z)=(Y, Z)$ in law, then, for any bounded Borel functions $f_1: \mathbb{R}^2\rightarrow \mathbb{R}$ and $f_2: \mathbb{R}\rightarrow \mathbb{R}$, we have that \begin{align*} E(f_1(X, Z))=E(f_1(Y, Z))\tag{1} \end{align*} and that \begin{align*} E(f_2(X))=E(f_2(Y)).\tag{2} \end{align*} Consequently, for any Borel set $A$, \begin{align*} \int_{Y \in A} h_2(Y) dP &= \int_{Y \in A} E(g(Z)\mid Y) dP\\ &=\int_{Y \in A} g(Z) dP \\ &=\int_{\Omega} 1_{Y\in A}g(Z) dP\\ &=E(1_{Y\in A}g(Z))\\ &=E(1_{X\in A}g(Z)) \qquad (\text{From } (1))\\ &=\int_{X\in A}g(Z) dP\\ &=\int_{X\in A}E(g(Z)\mid X) dP\\ &=\int_{X\in A}h_1(X) dP\\ &=E(h_1(X) 1_{X\in A})\\ &=E(h_1(Y) 1_{Y\in A}) \qquad (\text{From } (2))\\ &=\int_{Y \in A} h_1(Y) dP. \end{align*} Therefore, $h_1(Y)=h_2(Y)$ a.s.