In topology a space $X$ is called connected if there is no partition of $X=A\cup B$, that $A$ and $B$ are open. Since ergodic systems have the property that each trajectory visits any neighbourhood of any point in state space infinitely many times it appears to me that the state space of an ergodic system should be connected (and maybe even path connected ). Is there such a theorem for it or can somebody give a counter-example please?
EDIT:
Based on the answer below I realised that I forgot to mention the extra assumption of a continuous $T$ on this ergodic system.
Here is a counterexample. Start with $f : S^1 \to S^1$ being a rotation through an angle $\phi$ which is an irrational multiple of $\pi$: $$f(\exp(i \theta)) = \exp(i(\theta + \phi))$$ This is ergodic with respect to the angle measure. Now remove the orbit of one point, say the orbit of $0$, so the map $f$ is being restricted to the set $$X = S^1 - \{\exp(i k \phi) \,\, | \,\, k \in \mathbb{Z}\} $$ Since the subset being removed is countable, it has measure zero, and therefore the restriction of $f$ to $X$ is still ergodic with respect to the restriction of the angle measure. But $X$ is totally disconnected.