Why are clopen sets a union of connected components?

Here is what I mean: If $C$ is clopen subset of a space $X$, then $C=\cup_{x\in C}C_x$, where $C_x$ is the connected component in $X$ containing $x$.
It is clear that $C\subset \cup_{x\in C}C_x$.
Let $x\in C$, and we want to show that $C_x\subset C$. Now we take $A=C_x\cap C$ and $B=C_x\cap C^c$, we have $A\cup B=C_x$ and $A\cap B=\emptyset $ and $A$, $B$ are closed subsets in $C_x$ hence opens subsets in $C_x$, since $C_x$ is connected then $A=\emptyset$ or $B=\emptyset$, but $x\in A$, so $B=\emptyset$, this show that $A=C_x$, $i.e$ $C_x\subset C$.


Take the space $\mathbb{R}$. Then the subset $\mathbb{R}_{>0}$ of positive elements is a subset of $\mathbb{R}$, but is not a union of connected components of $\mathbb{R}$ (the only connected component of $\mathbb{R}$ is $\mathbb{R}$ itself). But then that's okay, because $\mathbb{R}_{>0}$ isn't clopen in $\mathbb{R}$ (it is only open).

What you seem to be doing here (I think) is to pass down to a subset of a topological space but then change the notion of connected component (perhaps to the connected components of the subspace with the subspace topology). What the above is saying is that if $U \subset X$ is a clopen subset of the space $X$, then it is a union of connected components of $\bf{X}$ (not of $U$).