Let M be a set endowed with the topology T.
It is said that A ⊂ M is connected if A can not be written as the disjoint union of two open or nor empty set, or more formally,

A = A1 U A2, con A1, A2 ∈ T and
A1 ∩ A2 = ∅

then A1 = ∅ or A2 = ∅

Observación: An equivalent definition is that a set A ⊂ M is connected
if the only open and closed subsets are the proper A and ∅in
A topology inherited from M. This is because if A were not connected, then there exists B and C open and not empty sets such us

A = B U C with B, C ∈ T

Then, B is open in the topology inherited, but it is also closed because its complement, C, is opened.