A useful tool in matters of conditional expectations is sometimes called the collectivist approach and may be summarized as follows:
To show that some specific object $c_0$ has a given property, study the collection $\mathcal C$ of objects $c$ with said property. Then the fact that $c_0$ is in $\mathcal C$ often becomes obvious, for example because $\mathcal C$ contains all the objects $c$ sharing some feature of $c_0$.
Here, one is given a random variable $X:\Omega\to\mathbb X$, a sub-sigma-algebra $\mathcal G$ on $\Omega$, a random variable $Y:\Omega\to\mathbb Y$, measurable with respect to $\mathcal G$, and a bounded measurable function $f:\mathbb Y\times\mathbb X\to\mathbb R$. One defines a function $G_f:\mathbb Y\times\Omega\to\mathbb R$ by $G_f(y,\omega)=E(f(y,X)\mid\mathcal G)(\omega)$ and a random variable $Z_f:\Omega\to\mathbb R$ by $Z_f(\omega)=G_f(Y(\omega),\omega)$.
One wants to show that $E(f(Y,X)\mid\mathcal G)=Z_f$.
Consider the collection $\mathcal C$ of bounded measurable functions $u:\mathbb Y\times\mathbb X\to\mathbb R$ such that $E(u(Y,X)\mid\mathcal G)=Z_u$. The goal is to show that $f$ is in $\mathcal C$.
Assume first that $u=\mathbf 1_{F\times E}$ for some measurable subsets $F$ and $E$ of $\mathbb Y$ and $\mathbb X$ respectively.
- If $y\in F$, $u(y,\cdot)=\mathbf 1_E$ hence $G_u(y,\omega)=P(X\in E\mid\mathcal G)(\omega)$ for every $\omega$.
- If $y\notin F$, $u(y,\cdot)=0$ hence $G_u(y,\omega)=0$ for every $\omega$.
Thus, $G_u(y,\omega)=P(X\in E\mid\mathcal G)(\omega)\cdot\mathbf 1_F(y)$ for every $\omega$, that is, $Z_u=P(X\in E\mid\mathcal G)\cdot\mathbf 1_F(Y)$.
On the other hand, $u(Y,X)=\mathbf 1_F(Y)\cdot\mathbf 1_E(X)$ and $\mathbf 1_F(Y)$ is $\mathcal G$-measurable hence
$$
E(u(Y,X)\mid\mathcal G)=\mathbf 1_F(Y)\cdot E(\mathbf 1_E(X)\mid\mathcal G)=\mathbf 1_F(Y)\cdot P(X\in E\mid\mathcal G).
$$
One sees that $Z_u=E(u(Y,X)\mid\mathcal G)$. Thus, every $u=\mathbf 1_{F\times E}$ is in $\mathcal C$.
The next step is to consider step functions $u=\sum\limits_{n=1}^Na_n\mathbf 1_{F_n\times E_n}$ for some $N\geqslant1$, measurable subsets $F_n$ and $E_n$ of $\mathbb Y$ and $\mathbb X$ respectively, and numbers $a_n$. A simple argument shows that every such function $u$ is in $\mathcal C$ (linearity?).
The last step is to note that any bounded measurable function $u:\mathbb Y\times\mathbb X\to\mathbb R$ is a limit of step functions as above, and that another standard argument shows that every such function $u$ is in $\mathcal C$ (dominated convergence?).
This finishes the proof that $f$ is in $\mathcal C$.
Finally, note that it is often the case, as here, that the first step (the functions $u=\mathbf 1_{F\times E}$) requires a relative amount of care but that the successive subsequent extensions are routine.
Edit: All this is quite classical. A congenial reference is the so-called little blue book Probability with martingales by David Williams.