Prove that each component of $X$ is a closed subset of $X$.
Solution 1:
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.
Solution 2:
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.