This is cross-posted from math.se, where I got no responses.
Let's say that a measurable space $(Z, \mathcal Z)$ has the "Doob-Dynkin property" iff for any set $X$, measurable space $(Y, \mathcal Y)$ and function $f:X\to Y$, a function $g:X\to Z$ is $f^{-1}(\mathcal Y)$ measurable if and only if it's a measurable function of $f$. This, with $\mathbb R$ playing the role of $Z$, is the Doob-Dynkin lemma as I was taught it.
It's easy to show that not every measure space has the Doob-Dynkin property. But let's say a separating measure space is one in which, given $x\ne y$, there exists a measurable set containing $x$ but not $y$.
Does every separating measure space have the Doob-Dynkin property?
I think I have a simple proof that this is the case when $f$ is surjective. Can this result be proven for a non-surjective $f$, or is there a counter-example?
Here's an outline of my proof.
First - with the above notation, if $g$ is $f^{-1}(\mathcal Y)$ measurable, and $Z$ separates points, then $g$ is a function (not necessarily measurable) of $f$. Proof: we only need to show that $f(x)=f(y)\implies g(x)=g(y)$, so let $x$ and $y$ be such that $f(x)=f(y)$. Then every set in $f^{-1}(\mathcal Y)$ either contains $x$ and $y$, or contains neither. If $g(x)\ne g(y)$, then let $A$ be some set of $\mathcal Z$ containing $g(x)$ but not $g(y)$. Then $g^{-1}(A)$ contains $x$ but not $y$ and so is not in $f^{-1}(\mathcal Y)$, thus $g$ is no measurable. Thus $g$ is a function of $f$, say $g=h\circ f$.
If $f$ is surjective then $h$ (which is unique when $f$ is surjective) is measurable. Proof: let $A\in \mathcal Z$. Since $g$ is $f^{-1}(\mathcal Y)$ measurable, $g^{-1}(A)=f^{-1}(B)$ for some $B\in\mathcal Y$. One can check that $h^{-1}(A)=B$.