Question:
Let $Z$ be a real-valued random variable, $X,Y$ be random elements. Suppose $X=Y$ almost surely. Then does there exist a function $h$ such that $E(Z|X)=h(X)=h(Y)=E(Z|Y)$ almost surely or $E(Z|X)$ is a version of $E(Z|Y)$?
(note for something to be called a version of $E(Z|X)$, we not only need almost surely equivalence, but we also need measurable wrt the image sigma algebra of $X$)
Attempt:
I think showing that $E(Z|X)=E(Z|Y)$ almost surely is not a problem, which implies there exists $\sigma(X)$ measurable $f$ and $\sigma(Y)$ measurable $g$ such that $E(Z|X)=f(X)=g(Y)=E(Z|Y)$ almost surely. However, can we deduce further? Or under what conditions can we deduce further?
Let $h(X)=E(Z|X)$ and let us show that $h(Y)=E(Z|Y)$. We have to show that $\int_{Y^{-1}(A)} h(Y)dP=\int_{Y^{-1}(A)} ZdP$ for every Borel set $A$ in $\mathbb R$. In other words we have to show that $\int g(Y)dP=\int_{Y^{-1}(A)} ZdP$ where $g=hI_A$. I will let you check that $\int g(Y)dP=\int g(X)dP=\int_{X^{-1}(A)} h(X)dP=\int_{X^{-1}(A)} ZdP=\int_{Y^{-1}(A)} ZdP$ using the fact that $(X^{-1}(A))\Delta (Y^{-1}(A))\subseteq \{X\neq Y\}$