A problem in Jun Shao mathematical statistics:exercises and solutions P33 Let $X$ be an integrable random variable with a lebesgue density $f$ and let $Y\ =\ g(X)$, where $g$ is a function with positive derivative on $(0,\infty)$ and $g(x)=g(-x)$. Find an expression for $E(X|Y)$.
My question is how to find the expression, is there a procedure to find?
 A: Let start with special case $g(X)=X^2$
since $X^2$ is a function with positive derivative on $(0,\infty)$ and also is symmetric $
if $X^2=t=0$ so $X=0$ then $E(X|X^2=0)=0$ 
define $A=R^{+}=\{x|x>0\}$ 
if $t>0$ so
$E(X|X^2=t)=E(XI_R(X)|X^2=t)=E(XI_{A\cup A^{\prime}}|X^2=t)=
E(X(I_{A}+ I_{A^{\prime}})|X^2=t)$
$=E(XI_{A}|X^2=t)+ E(XI_{A^{\prime}}|X^2=t)$
$=E(XI_{X>0}|X^2=t)+ E(XI_{X<0}|X^2=t)$
$=E(\sqrt(X^2)I_{(X>0)}|X^2=t)+ E(-\sqrt(X^2)I_{(X<0)}|X^2=t)$
$=\sqrt(t)E(I_{(X>0)}|X^2=t)- \sqrt(t)E(I_{(X<0)}|X^2=t)$
$=\sqrt(t)P(X>0|X^2=t)- \sqrt(t)P(X<0|X^2=t)$
$=\sqrt(t)\bigg(P(X>0|X^2=t>0)- P(X<0|X^2=t>0)\bigg)$ 
$=\sqrt(t)\bigg(\frac{p(X>0\cap X^2=t)}{p(X^2=t)}- \frac{p(X<0\cap X^2=t)}{p(X^2=t)}\bigg)$ 
$=\frac{\sqrt(t)}{p(X^2=t)}\bigg(p(X>0\cap X^2=t)- p(X<0\cap X^2=t)\bigg)$ 
$=\frac{\sqrt(t)}{p(X=\sqrt(t) or X=-\sqrt(t))}\bigg(p( X=\sqrt(t))- p(X=-\sqrt(t))\bigg)$ 
$=\frac{\sqrt(t)}{p(X=\sqrt(t) or X=-\sqrt(t))}\bigg(p( X=\sqrt(t))- p(X=-\sqrt(t))\bigg)$ 
$=\sqrt(t) \bigg(\frac{f(\sqrt(t))-f(-\sqrt(t))}{f(\sqrt(t))+f(-\sqrt(t))} \bigg)$
for general case :
let $g(0)=t_0$ so  $(g(x)=t\neq t_0)$ (case $t=t_0$ is easy to get)
let $h$ is the inverse of $g(x)$ in $x \in A=R^{+}$
$E(X|g(X)=t)=E(XI_R(X)|g(X)=t)=E(XI_{A\cup A^{\prime}}|g(X)=t)=
E(X(I_{A}+ I_{A^{\prime}})|g(X)=t)$
$=E(XI_{A}|g(X)=t)+ E(XI_{A^{\prime}}|g(X)=t)$
$=E(XI_{X>0}|g(X)=t)+ E(XI_{X<0}|g(X)=t)$
since $g$ in $(0,\infty)$ is increasing and in $(-\infty,0)$ is decreasing 
$=E(h(t)I_{X>0}|g(X)=t)+ E(-h(t)I_{X<0}|g(X)=t)$
$=h(t)E(I_{X>0}|g(X)=t)-h(t) E(I_{X<0}|g(X)=t)$
$=h(t)\bigg(E(I_{X>0}|g(X)=t)- E(I_{X<0}|g(X)=t)\bigg)$
$=h(t)\bigg(p(X>0|g(X)=t)- p(X<0|g(X)=t)\bigg)$
$=h(t)\bigg(\frac{p(X>0 \cap g(X)=t)}{p(g(X)=t)} - \frac{p(X<0 \cap g(X)=t)}{p(g(X)=t)}    \bigg)$
$=h(t)\bigg(\frac{p(X=h(t))}{p(g(X)=t)} - \frac{p(X=-h(t))}{p(g(X)=t)}    \bigg)$
$=h(t)\bigg(\frac{p(X=h(t))}{p(X=h(t)  \cup X=-h(t) )} - \frac{p(X=-h(t))}{p(X=h(t)  \cup X=-h(t) )}    \bigg)$
$=h(t)\bigg(\frac{f(h(t))}{f(h(t))+ f(-h(t) )} - \frac{f(-h(t))}{f(h(t))+ f(-h(t) )}    \bigg)$
$=h(t)\bigg(\frac{f(h(t))-f(-h(t))}{f(h(t))+ f(-h(t) )}   \bigg)$
so 
$E(X|Y=t)=h(t)\bigg(\frac{f(h(t))-f(-h(t))}{f(h(t))+ f(-h(t) )}   \bigg)$
$E(X|Y)=h(Y)\bigg(\frac{f(h(Y))-f(-h(Y))}{f(h(Y))+ f(-h(Y) )}   \bigg)$
$h$ is inverse of $g$ in $(0,\infty)$
now to sure you can check the answer by definition of conditional expectation (Jun Shao" method) 
"Jun Shao" method:


