Substitute Concrete Value in Conditional Expectation 
*

*Let $(\Omega, \mathcal{G}, \mathbb{P})$ be a probability space.

*Let  $$ X, Y : \Omega \rightarrow \mathbb{R} $$ be random variables.

*Furthermore, let
$$ f: \mathbb{R}^2 \rightarrow \mathbb{R} $$
be a $\mathcal{B}(\mathbb{R}^2)/\mathcal{B}(\mathbb{R})$-measurable function 
such that, for all $y \in \mathbb{R}$, the random variables $f(X,y)$ and 
$f(X,Y)$ have finite expectation.


Now let $y \in \mathbb{R}$ be arbitrary. Under the above assumptions, the expected value $\mathbb{E}[f(X,y)]$  and a $\mathbb{P}$-unique conditional expectation $\mathbb{E}[f(X,Y) \mid Y]$ do exist. 
Furthermore, since $\mathbb{E}[f(X,Y) \mid Y]$ is $\sigma(Y)/\mathcal{B}(\mathbb{R})$-measurable, there exists a $\mathbb{P}_Y$-unique $\mathcal{B}(\mathbb{R})/\mathcal{B}(\mathbb{R})$-measurable function
$$ \varphi : \mathbb{R} \rightarrow \mathbb{R} $$
such that $\varphi(Y) = \mathbb{E}[f(X,Y) \mid Y]$.
Under which circumstances does it hold, that $\varphi$ can be chosen such that
$$ \varphi (y) = \mathbb{E}[f(X,y)]  $$
and why?
Thanks in advance for any advice!
 A: *

*Suppose that $X$ and $Y$ are independent. Let $B$ be a Borel subset of $\mathbb R$. Then by independence, the law of $(X,Y)$ is the product of the marginals.
$$ \mathbb E\left[f(X,Y)\mathbf 1\{Y\in B\}\right]=\int_{\mathbb R}\int_{\mathbb R}f(x,y)\mathbf 1_B(y)\mathrm dP_X(x)\mathrm dP_Y(y)=\int_{\mathbb R}\mathbf 1_B(y)\left(\int_{\mathbb R}f(x,y)\mathrm dP_X(x)\right)\mathrm dP_Y(y)
$$
and the term between the parenthesis is $\varphi(y)$ hence we proved that for all Borel subset $B$ of $\mathbb R$, 
$$
\mathbb E\left[f(X,Y)\mathbf 1\{Y\in B\}\right]=\mathbb E\left[\varphi(Y)\mathbf 1\{Y\in B\}\right]
$$
which proves that $\mathbb E\left[f(X,Y)\mid  Y \right]=\varphi(Y)$.

*If $X$ and $Y$ are not independent, there exists Borel subsets $A$ and $B$ of $\mathbb R$ such that $\mathbb P\left(\{X\in A\}\cap \{Y\in B\}\right)\neq \mathbb P\{X\in A\}\mathbb P\{Y\in B\}$. Then let $f(x,y):=\mathbf 1_A(x)$ and do the test in the definition of conditional expectation with $\mathbf 1_B(Y)$ to see that $\mathbb E\left[f(X,Y)\mid  Y \right]=\varphi(Y)$ does not hold.
