Suppose that $\pi : (X, \Sigma_X) \to (Y, \Sigma_Y)$ is a measurable surjection between two measurable spaces. Let $F = \pi^{-1} (\Sigma_Y)$ be the sub $\sigma$ algebra of $\Sigma_X$. Let $f : X \to (\mathbb{R}, B)$ be a measurable function to the reals with the Borel sigma algebra (or to any Hausdorff space with the Borel sigma algebra).
Question: Is $f$ $F$ measurable iff there is a measurable function $g : Y \to \mathbb{R}$ so that $f = g \circ \pi$?
I'm fairly certain I can prove this, and I can provide my argument if someone wants to see it. However, because these are all tricky measure theory technicalities, I'm asking here to be sure. Maybe someone knows a counter example off the top of their head.
Rmk: The surjectivity of $\pi$ is necessary, a counter example is the inclusion of a non-measurable set $X$ into $Y = \mathbb{R}$, with $f = 1_{X}$ and the induced sigma algebra on $X$. Edit: Nevermind, I was being silly. $1_Y$ also pulls back to $1_X$ -- no uniqueness in this case. :)