Problem about separating class of function This is the Problem 3.7 of Ethier and Kurtz's Markov Processes Characterization and Convergence

Let $X$ and $Y$ be $S$-valued ($S$ is a metric space) random variables defined on a probability space $(\Omega,\mathcal F,P)$, and let $\mathcal G$ be a sub-$\sigma$-algebra of $\mathcal F$. Suppose that $M\subset \bar{C}(S)$ ($\bar{C}(S)$ is the set of all bounded continuous functions on $S$) is separating and 
  $$E[f(X)|\mathcal G]=f(Y)$$
  for every $f\in M$. Show that $X=Y$ a.s.

Where separating means that if whenever $P$, $Q$ are probability measures on $S$ and for every $f\in M$
$$\int f dP=\int f dQ$$
we have $P=Q$.
Since $E[f(X)]=E[f(Y)]$ for every $f\in M$ and $M$ is separating, we have $X$ and $Y$ have the same distribution. So for every $f\in M$
$$E[f(X)f(Y)]=E[f^2(Y)]=E[f^2(X)]$$
Then
$$E[(f(X)-f(Y))^2]=0$$
we have $f(X)=f(Y)$ a.s. for every $f\in M$.
If the problem has the additional condition that $M$ has a countable subset $\{f_i\}$ which separate the point in $S$, then $X=Y$ a.s. follows immediately. But without this condition how to get the result?
 A: The First Proof
This proof is inspired by the proof of Proposition 3.4.6. in the same book.
Since $E[f(X)|\mathcal G]=f(Y)$, then for every $f,h\in M$ it has
$$E[f(X)h(Y)]=E[f(Y)h(Y)]$$
i.e.
$$\int\int f(x_1)h(x_2)P_{X,Y}(dx_1,dx_2)=\int\int f(x_1)h(x_2)P_{Y,Y}(dx_1,dx_2)$$
Let
$$\mu(dx_1,dx_2)=h(x_2)P_{X,Y}(dx_1,dx_2)$$
$$\nu(dx_1,dx_2)=h(x_2)P_{Y,Y}(dx_1,dx_2)$$
and let $\mu^1$ and $\nu^1$ be the first marginals of $\mu$ and $nu$ on $\mathcal B(S)$. Then for every $f\in M$
$$\int f(x_1)\mu^1(dx_1)=\int\int f(x_1)h(x_2)P_{X,Y}(dx_1,dx_2)=\int\int f(x_1)h(x_2)P_{Y,Y}(dx_1,dx_2)=\int f(x_1)\nu^1(dx_1)$$
i.e. $M$ separating $\mu^1$ and $nu^1$. Since
$$\mu^1(S)=\int\int h(x_2)P_{X,Y}(dx_1,dx_2)=E[h(Y)]=\int\int h(x_2)P_{Y,Y}(dx_1,dx_2)=\nu^1(S)$$
by the property in this post, it has $\mu^1=\nu^1$. (Be care it is right without the condition $1\in M$ in this case). So for every $\Gamma_1 \in \mathcal B(S)$
$$\int\int 1_{\Gamma_1}(x_1)h(x_2)P_{X,Y}(dx_1,dx_2)=\int\int 1_{\Gamma_1}(x_1)h(x_2)P_{Y,Y}(dx_1,dx_2)$$
By the same reasoning (a little difference is that it needs using $X$ and $Y$ have the same distribution) it can be proved that
$$\int\int 1_{\Gamma_1}(x_1)1_{\Gamma_2}(x_2)P_{X,Y}(dx_1,dx_2)=\int\int 1_{\Gamma_1}(x_1)1_{\Gamma_2}(x_2)P_{Y,Y}(dx_1,dx_2)$$
i.e. $(X,Y)$ and $(Y,Y)$ have the distribution. So it can be proved for every bounded measurable function $f$
$$E[(f(X)-f(Y))^2]=0$$
so $X=Y$ a.s.
The Second Proof
Since for every $f\in M$ $E[f(X)|\mathcal G]=Y$, then
$$E[f(X)h(Y)]=E[f(Y)h(Y)]$$
for all $h$ is positive measurable function.
For each $A\in\mathcal B(E)$, define 
$$\mu_X(A)=E[1_A(X)h(Y)]$$
$$\mu_Y(A)=E[1_A(Y)h(Y)]$$
by monotone convergence theorem, it can be verified $\mu_X$ and $\mu_Y$ are both measures on $\mathcal B(E)$ and $\mu_X(E)=\mu_Y(E)$. Since
$$\int f\mu_X=E[f(X)h(Y)]=E[f(Y)h(Y)]=\int f\mu_Y$$
for every $f\in M$ and $M$ is separating, then $\mu_X=\mu_Y$. So for all $f,h$ is positive measurable function, we have
$$E[f(X)h(Y)]=E[f(Y)h(Y)]$$
The remaining is same as in the first proof.
