Definition:Separation (Topology)

Definition
Let $T = \left({S, \vartheta}\right)$ be a topological space.

Then a partition (or a separation) $A \mid B$ of $T$ is a pair of subspaces $A, B \subseteq T$ such that:
 * $A$ and $B$ form a (set) partition of the set $S$
 * Both $A$ and $B$ are open in $T$.

It follows that not only are $A$ and $B$ are open in $T$, they are also both (by definition) closed in $T$.

Also see
Having no partition is equivalent to being connected, a fact which is demonstrated in Equivalence of Connectedness Definitions.