Conditional expectations by conditioning on functions of random variables I have conjectured the following:
Let $f:\mathbb{R}\supseteq A \rightarrow B \subseteq \mathbb{R}$ be an injective function. Let $X$ be a random variable with support $A$ and $Y$ be some random variable that is not independent from $X$. Then, $$E[Y | X=x]=E[Y|f(X)=f(x)].$$
Is that correct? If it is correct, is there any "weaker" assumption (weaker than $f$ being injective) that would make this true?
Thanks.
 A: Injectivity is sufficient (so long as your function is measurable)
Let's assume that $f$ is a measureable function, so that all relevant random variables and events are well-defined.  Now, to give this some more structure, suppose we are working in a probability space $(\Omega, \mathscr{S}, \mathbb{P})$ so that $X: \Omega \rightarrow A$ is your conditioning random variable of interest.  Since $f$ is an injective function it has a left-inverse $g: B \rightarrow A$ (i.e., $g(f(x))=x$ for all $x \in A$).  Thus, for all $x \in A$ you have the following event equivalence:
$$\begin{align}
\{ \omega \in \Omega | f(X(\omega)) = f(x) \} 
&= \{ \omega \in \Omega | g(f(X(\omega))) = g(f(x)) \} \\[6pt]
&= \{ \omega \in \Omega | X(\omega) = (x) \} \\[6pt]
\end{align}$$
This means that conditioning on $f(X)=x$ is equivalent to conditioning on $X=x$.  Thus, so long as $f$ is measureable, that should be enough to obtain equivalence of the conditional expectations.  (Proof of this is a bit more involved, since you need to establish this via the Radon-Nikodym form for conditional expectation, or via theorems about sigma-fields; that should not be especially difficult.)
A: if $Z=f(X)$ and $f$ is injective function so $$\sigma(Z)=\sigma(X)$$
since $Z=f(X)$ so $$\sigma(Z) \subset \sigma(X)$$
and because $f$ is injective so $X=f^{-1}(Z)=g(Z)$ so  $$\sigma(X) \subset \sigma(Z)$$ 
so $\sigma(Z)=\sigma(X)$ or $\sigma(f(X))=\sigma(X)$
now $$E(Y|X)=E(Y|\sigma(X))=E(Y|\sigma(f(X)))=E(Y|f(X))$$
A: Assuming $f$ is measurable I think the weakest condition is:

*

*Whenever $\mathbb{E}(Y|X=x_1) \ne \mathbb{E}(Y|X=x_2), f(x_1) \ne f(x_2)$.

