Let (X, d) be a metric space and define a binary relation on X via

x ~ y iff there is a connected set with x, y in . The equivalence classes are known as the connected components of X.

Show that every connected component is closed.

I tried to show that the complement of every connected component is open, but didn't get far.