# For rv $X$ such that $|X|\le 1$ a.s, show existence of $Y$ with values in $\{-1,1\}$ and $E(Y|X)=X$

This question comes from "Probability Theory" by Achim Klenke, pg. 198. Any hints are appreciated.

-

So, you know the value of $X$, say $X=x$ for a given real number $x$ such that $|x|\leqslant1$, and you want to define $Y$ such that $Y=1$ with probability $\frac12(1+x)$ and $Y=-1$ with probability $\frac12(1-x)$.
Assume that you draw an independent random variable $U$ uniform on $(-1,1)$ and that you define $Y$ as $Y=+1$ if $U\in B_x$ and $Y=-1$ if $U\notin B_x$ for a given Borel set $B_x\subseteq(-1,1)$. Then $$\mathrm E(Y\mid X=x)=(+1)\cdot\tfrac12|B_x|+(-1)\cdot\tfrac12|(-1,1)\setminus B_x|=|B_x|-1,$$ hence this construction yields a solution if $|B_x|=1+x$ for every $x$. Can you finish?
I went back to make the proof more rigorous. The required random variable is $Y=1_{\{U \in B_X\}} - 1_{\{U \notin B_X\}}$. The tricky part is to formally prove that $P(U \in B_X | X=x) = P(U \in B_x)$ –  kbell Nov 20 '11 at 4:57
Proof of the above equality comes as a consequence of the following result: Let $X$ and $Y$ be independent and $\varphi: \mathbb{R}\times\mathbb{R}\rightarrow [0,\infty]$ be measurable. Let $E$\varphi(\cdot,Y)$$ denote $x\mapsto E$\varphi(x,Y)$$. Then $E$\varphi(\cdot,Y)$\circ X$ is a version of $E$\varphi(X,Y)|X$$ (exercise in "Probability Theory", Heinz Bauer pg 128). –  kbell Nov 20 '11 at 7:20