# If $g$ is invariant under an ergodic map then it's almost everywhere constant

Let $(X,B(X),\mu)$ be a probability space, where $X$ is compact metrizable, and $B(X)$ are the Borel sets. Let $f:X\to X$ be a measurable function such that:

i) $\forall A\in B(X)$ $\mu(f^{-1}(A))=\mu A$

ii) If $A\in B(X)$ is $f$-invariant (i.e $f^{-1}(A)=A$) then $\mu(A)\in \{0,1\}$. We call $f$ an ergodic function with respect to the measure $\mu$.

I want to prove that if $f$ is ergodic with respect to $\mu$ and $g:X\to \mathbb R$ is such that $g(f(x))=g(x) \forall x\in X$ then $g$ is constant almost everywhere.

I think that this problem it's very easy, but I want to see it anyway, to see some examples of this new definition.

It works in more general dynamical systems, not only when $X$ is compact metrizable. Define for each real number $c$ $$A_c:=\{x\mid g(x)\geqslant c\}.$$ Then $f^{-1}(A_c)=A_c$. Then take $c_0:=\inf\{c,\mu(A_c)=0\}$ and show that $g=c_0$ almost everywhere.
• We have for each $n$ that $\mu(A_{c_0+1/n})=0$, hence $g\leqslant c_0$ a.e. Since $\mu(A_{c_0-1/n})=1$ for each $n$, we obtain the wanted equality. – Davide Giraudo Jun 23 '14 at 15:24