TITLE: Is there any counterexample to show that $X,Y$ are two random variables and $E(X\mid Y)=E(X)$, but $X$ and $Y$ are not independent.
QUESTION [5 upvotes]: Is there any counterexample to show that $X,Y$ are two random variables and $E(X\mid Y)=E(X)$, but $X$ and $Y$ are not independent. 
I already know that if $X,Y$ are independent, then $E(X\mid Y)=E(X)$.

REPLY [4 votes]: \begin{align}
X & = \begin{cases} -1 \\ \phantom{-}0 & \text{each with probability } 1/3 \\ +1 \end{cases} \\[10pt]
Y & = X^2
\end{align}
Then $\operatorname E(X\mid Y=0) = 0$ and $\operatorname E(X\mid Y=1) = 0,$ so $\operatorname E(X\mid Y) = 0$ with probability $1.$ But $X$ and $Y$ are very far from independent.