Given a probability space $(\Omega, \mathcal{F}, \mathbb{P})$ such that $\Omega$ is a Polish space.
Suppose that $X$ and $Y$ are square integrable random variables valued in $\mathbb{R}^d$ such that $\mathbb{E}\left[X\right] = \mathbb{E} \left[Y\right] = 0$, prove that $\mathbb{E}\left[X | Y\right] = 0$ a.s. if $\mathbb{E} \left[X f(Y)\right] = 0$ for any continuous and bounded function $f$ in $C_b(\mathbb{R}^d)$.
Attempt:
$\mathbb{E} \left[ X f(Y)\right] = \mathbb{E}\left[ f(Y) \mathbb{E}\left[X|Y\right]\right]$, and $\mathbb{E} \left[ X|Y \right] = g(Y)$ for some Borel measurable function $g$. If we assume $g(Y) \in L^2(\Omega)$, we may find a sequence of functions $(f_n)_{n \in \mathbb{N}}$ such that it converges to $g(Y)$ in $L^2(\Omega)$-norm. Then $\mathbb{E}\left[\mathbb{E}\left[X|Y\right]^2\right] = \mathbb{E}\left[Xf(Y)\right]= 0$, which implies $\mathbb{E}\left[X|Y\right] = 0$ a.s.
I have 2 questions for the above idea. We know $C_b(\mathbb{R}^d)$ is dense in $L^2(\mathbb{R}^d)$, is it still true if we replace $\mathbb{R}^d$ by a Polish space $\Omega$? If we relax the $L^2$ condition for $g(Y)$, can we have a different approach?
Hints: Let $C$ be a closed set in $\Omega$. Then there exist continuous functions $f_n$ such that $0 \leq f_n \leq 1$ and $f_n(x)\to I_C(x)$ for all $x$. (1)
It follows that $EXI_C(Y)=0$ for every closed set $C$. Let $\mu (B)=EXI_B(Y)$. Then $\nu$ is ral measure an any finite measure on a Polish space is regular. [Ref.: Billingsley's Convergence of Probability Measures]. Since $\nu (C)=0$ for $C$ closed it follows that $\nu (B)=0$ for every Borel set $B$. Now the definition of conditional expectation shows that $E[X|Y]=0$.
(1) Let $U_n=\{x: d(x,C) <\frac 1n\}$. Then $(U_n)$ is a decreasing sequence of open sets with intersection $C$. Let $f_n(x)=\frac {d(x,U_n^{c})} {d(x,U_n^{c})+d(x,C)}$. This sequence does the job for you.