Let

- $(\Omega,\mathcal A,\operatorname P)$ be a probability space
- $\mathcal F\subseteq\mathcal A$ be a $\sigma$-algebra on $(\Omega,\mathcal A)$
- $(E,\mathcal E)$ be a measurable space
$f:\Omega\times E\to\mathbb R$ be $\mathcal A\otimes\mathcal E$-measurable

Assume $$\operatorname E\left[\left|f(\;\cdot\;,x)\right|\right]<\infty\;\;\;\text{for all }x\in E.\tag1$$ It's easy to show that there is a $\mathcal F\otimes\mathcal E$-measurable $g:\Omega\times E\to\mathbb R$ with $$\operatorname E\left[f(\;\cdot\;,x)\mid\mathcal F\right]=g(\;\cdot\;,x)\;\;\;\text{almost surely for all }x\in E.\tag2$$ Now, let $X:\Omega\to E$ be $\mathcal F$-measurable with $$\operatorname E\left[\left|f(\;\cdot\;,X)\right|\right]<\infty.\tag3$$

I want to show that $$\operatorname E\left[f(\;\cdot\;,X)\mid\mathcal F\right]=g(\;\cdot\;,X)\;\;\;\text{almost surely}.\tag4$$

Assume $f$ is the indicator function $1_{A\times B}$ of some $(A,B)\in\mathcal A\times\mathcal E$. In that case, $$g(\;\cdot\;,x)=\operatorname E\left[1_A\mid\mathcal F\right]\:1_B(x)\;\;\;\text{almost surely for all }x\in E\tag5.$$ Now, note that $g$ is not uniquely determined by $(2)$ and that the specific choice $$\tilde g(\omega,x):=\operatorname E\left[1_A\mid\mathcal F\right](\omega)1_B(x)\;\;\;\text{for }\omega\in\Omega\text{ and }x\in E$$ satisfies $(4)$.

How can we show that $(4)$ actually holds for any choice of $g$?