Prove that each component of $X$ is a closed subset of $X$.

Definition: Let $X$ be a topological space and let $\sim_C$ be the equivalence relation on $X$ defined by $x \sim_C y$ if $x$ and $y$ lie in a connected subset of $X$. The components of $X$ are the equivalence classes of the equivalence relation $\sim_C$.

Question: Prove that each component of $X$ is a closed subset of $X$.

Please guide me how to start to prove, or any clue. Thank you.

I think I came up with a simpler proof: That components are the largest connected subsets of $X$; I choose one of them, say $C$. Since C is connected in X, thus so is $Cl(C)$. Thus $C=Cl(C)$ and then $C$ is closed.
Let $C$ be a connected component. Let $x\in X$ be outside $C$; then $B=C\cup \{x\}$ is not connected. Let $U,V$ form a separation of $B$. Suppose $x\in U$; I claim that $U\cap C=\emptyset$. If not, then $U\cap C,V\cap C$ would form a separation of $C$, which is not possible since $C$ is connected. Thus $U\cap C=\emptyset$, hence $C$ is closed since its complement is open.
• Thank you but I have some problems in understanding your proof: If $y\in U$, "then" why $U$ doesn't contain $x$? and, Why "the complement of the component containing $x$ is open"? BTW, $X$ can be partitioned into more than two components. Thanks a lot. – L.G. May 5 '15 at 13:06