I'm trying to solve the following problem.
Let $(X, \mathcal{B}, \mu)$ be a probability space and let $T \colon X \to X$ be a measure preserving function. Prove that if $T^n \colon X \to X$ is ergodic for $n = 1, \dots, N-1$ but $T^N \colon X \to X$ is not ergodic, then there exists a set $A \in \mathcal{B}$ such that the sets $T^n(A)$ for $n = 0, \dots, N-1$ are disjoint (mod $\mu$) and $\bigcup_{n=0}^{N-1} T^n(A) = X$ (mod $\mu$).
I already prove the proposition assuming that $T$ is invertible (by taking $A$ as the set that makes the ergodicity of $T^N$ fail), but I haven't been able to prove it without this assumption. This problem appears in "Invitation to Ergodic Theory" in the same way I wrote it, so I think you really don't need to assume the invertibility of $T$.
Any help would be appreciated