* 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!



Substitute Concrete Value in Conditional Expectation
$\newcommand{\R}{\mathbb{R}}
\newcommand{\vpi}{\varphi}$
The answer is: the condition 



> 
> $E(f(X,Y)|Y)=\vpi(Y)$ for all $f$ such that $f(X,Y)$ has a finite expectation 
> 
> 
> 


holds iff $X$ and $Y$ are independent. 


Indeed, if $X$ and $Y$ are independent, then for each Borel subset $B$ of $\R$
\begin{align\*}
 EI\{Y\in B\}\vpi(Y)&=\int P(Y\in dy)I\{y\in B\}\vpi(y) \\ 
 &=\int P(Y\in dy)I\{y\in B\}Ef(X,y) \\ 
 &=\int P(Y\in dy)I\{y\in B\}\int P(X\in dx)f(x,y) \\ 
 &=\int P(X\in dx,Y\in dy)I\{y\in B\}f(x,y) \\ 
 &=EI\{Y\in B\}f(X,Y),
\end{align\*}
where $I$ is the indicator. So, $E(f(X,Y)|Y)=\vpi(Y)$. 


Vice versa, suppose that $E(f(X,Y)|Y)=\vpi(Y)$ for all $f$ such that $f(X,Y)$ has a finite expectation, where $\vpi(Y)=Ef(X,y)$ for all real $y$. Take any Borel subsets $A$ and $B$ of $\R$, and let $f(x,y):=I\{x\in A\}I\{y\in B\}$ for all real $x,y$. Then for each $y\in\R$
\begin{equation}
\vpi(y)=Ef(X,y)=EI\{X\in A\}I\{y\in B\}=P(X\in A)I\{y\in B\} 
\end{equation}
and 
\begin{align\*}
P(X\in A)P(Y\in B)&=EP(X\in A)I\{Y\in B\} \\ 
&=EI\{Y\in B\}\vpi(Y) \\ 
 &=EI\{Y\in B\}f(X,Y) \\
 &=EI\{X\in A\}I\{Y\in B\}=P(X\in A,Y\in B),
\end{align\*}
so that $P(X\in A,Y\in B)=P(X\in A)P(Y\in B)$. 


