Connectedness in Measure Preserving Ergodic Systems 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.
 A: 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.
A: With the amended formulation the answer is: X is always connected (since it contains a dense connected subset), but need not be path connected (just suspend Lee's example).
Edit: Suppose you have a continuous dynamical system (a flow), which is a continuous map $F: X\times {\mathbb R}\to X$. Then ergodicity of $F$ implies that almost every trajectory is dense in $X$. Every trajectory is clearly connected. If a topological space $X$ contains a dense connected subset $Y$ then $X$ is connected (follows from the definition). 
For path connectivity question: Every homeomorphism $f: Z\to Z$ admits a "suspension flow" $F$ on the mapping torus $X$ of $f$. If $f$ is ergodic, so is $F$. In Lee's example, $Z$ is totally disconnected and uncountable, hence, the mapping torus $X$ is not path-connected. 
Edit. The suspension flow is a standard construction which allows one to relate discrete and continuous dynamics. Suppose that $f: Z\to Z$ is a homeomorphism. Recall that the mapping torus $M_f$ of $f$ is the quotient
$$
Z\times [0,1]/\sim
$$
where $(z,0)\sim (f(z), 1)$. If $Z$ is equipped with a measure $\mu$, you take the product measure $\mu \times Leb$ and push it forward to $M_f$, where $Leb$ is the Lebesgue measure on $[0,1]$. The result is a measure $\nu$ on $M_f$ (of the same total mass as $\mu$). 
The mapping torus $M_f$ is foliated by the lines each of which is the union of projections of the segments of the type $z\times [0,1]$. For each of these lines you have the vector field $V$ which is the projection of the vector field $\frac{\partial}{\partial t}$ on the segments $z\times [0,1]$, where $0\le t\le 1$ is the natural coordinate on $[0,1]$. The flow $F_t$ of this vector field is the suspension flow of $f$. I think, this construction should be in the book by Katok and Hasselblatt. 
Note that $Z$ embeds homeomorphically in $M_f$ via the map $z\mapsto z\times 0\to M_f$. The relation between the dynamics of $f$ and of $F_t$ is via the following: Points $x, y\in Z$ are in the same orbit of $f$ if and only if their images in $M_f$ are in a common flow line of the flow (leaf of the foliation). If $f$ was preserving the measure $\mu$ then $F_t$ preserves $\nu$. If $(Z,\mu,f)$ is ergodic, so is $(M_f, \nu, F_t)$. (This is immediate from the definitions.)  
