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

x ~ y iff there is a connected set $\displaystyle B \subset X $ with x, y in $\displaystyle B$. 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.