Consider the random variables $Y,X$. I believe that we can always write $$ Y=E(Y|X)+\epsilon $$ with $E(\epsilon|X)=0$.
Question: Is the above true regardless whether $Y$ is a discrete or continuous random variable?
My thoughts: I believe that the answer is yes.
For example, let $Z$ be a discrete random variable and $Y\equiv \mathbb{1}\{Z=3\}$, where $\mathbb{1}\{\cdots\}$ is the indicator function taking value $1$ if the condition inside is satisfied and zero otherwise. We can write $$ \mathbb{1}\{Z=3\}= E(\mathbb{1}\{Z=3\}| X)+ \epsilon \quad E(\epsilon|X)=0 $$ that is $$ \mathbb{1}\{Z=3\}= Pr(Z=3|X)+ \epsilon \quad E(\epsilon|X)=0 $$