Consider description of the model solution in this mathexchange post: Proving that an ergodic and invariant map is constant a.e. We have that $(E, F, \mu)$ is a probability space, $\theta:E\to E$ is an ergodic transformation and $f:E\to \mathbb{R}$ is measurable function such that $f\circ \theta = f$ everywhere.
What isn't entirely clear to me from the model solution or from @user160629's answer https://math.stackexchange.com/a/852384/877219 is that how do we argue that the defined $c \equiv \inf \{a \in \mathbb{R}: \mu(f > a) = 0\}$ is finite? I understand it has something to do with $f \circ T = f$ on $E$ but I am not sure what exactly.