TITLE: Measure-preserving transformations and invariant functions
QUESTION [8 upvotes]: Let $\tau: E \to E$ be a measure-preserving transformation of the measure space $(E, \mathcal{E}, \mu)$, i.e. $\mu(\tau^{-1}(A)) = \mu(A)$ for all $A \in \mathcal{E}$. Let $\mathcal{E}_\tau = \{ A \in \mathcal{E} : \tau^{-1}(A) = A \}$. In my lecture notes, it is claimed that a measurable function $f$ is invariant (i.e. $f \circ \tau = f$) if and only if it is measurable with respect to $\mathcal{E}_\tau$.
This is evidently false: Let $E = \{ 0, 1 \}$, and let $\mathcal{E} = \mathcal{P}(E)$ be the power set. Let $\mu$ be the uniform distribution. Let $\tau$ act on $E$ by transposing 0 and 1. Let $f: (E, \mathcal{E}) \to (E, \mathcal{E}_\tau)$ be the identity map on $E$. Clearly, $f$ is measurable and not invariant. Yet it's also measurable with respect to $\mathcal{E}_\tau$: the preimage of every measurable set in its codomain is in $\mathcal{E}_\tau$, by construction.
Have I misinterpreted the claim? If not, is there a similar claim which is true, e.g. by fixing the codomain of $f$?

REPLY [3 votes]: I suspect that measurable function in the statement should be understood to be
real-valued measurable function, or something similar.
More generally, if each point $y$ in the codomain $Y$ of $f$ is measurable, and if $f$ is measuarble w.r.t. $\mathcal E_{\tau}$, then
we see that $f^{-1}(y)$ should be invariant under $\tau$, which is to say that
$f\circ\tau = f$.
The problem with your counter-example is that the points of $E$ are not in
your particular $\mathcal E_{\tau}$, and so the preceding argument breaks down
(as you implicitly noted!).