Number of connected components Invariant Why is the number of connected components invariant under homeomorphisms? I know that connectedness, as well as path connectedness, are properties conserved through homeomorphisms. But why is this really meaningful? For example, consider the set
$$A:=\{ (x,y) \in \mathbb{R}^2 : xy = 0\}.$$
I know this set is not a 1-manifold since for $A \setminus \{(0,0)\}$ any neighborhood of $(0,0)$ has 4 connected components and an open interval in $\mathbb{R}$ without a point has just 2. However, I think there could be some further details to take care rather than just comparing "4 against 2".
Could it be maybe possible to show this using the zero homology $H_0$? 
Many thanks
 A: Let $C(x,S)$ be the connected component of $S$ that contains $x$.
Assume 
$$h:X \to Y$$ is an homeomorphism. Show $h[C(x,X)] = C(h(x),Y)$ for all $x \in X$. Also show if $C(h(x),Y) = C(h(y),Y)$, then $C(x,X) = C(y,Y)$. Thus $h(\cdot)$ is an injection from the components of $X$ to those of $Y$.  
As $h^{-1}: Y \to X$ is a homeomorphism, likewise there is an injection from the components of Y to those of X. Thus by the Cantor–Bernstein theorem, the components of $X$ is equinumerous to the components of Y.
A: A component $C$ of $X$ is a maximal connected subset of $X$: $C$ is connected and if $C \subseteq C' \subseteq X$ and $C'$ is connected then $C'=C$.
It is standard that any two distinct components of $X$ are disjoint. So they form a partition of the space: to see they cover $X$ note that for any $x \in X$, $C_x := \bigcup \{ C \subseteq X: C \text{ connected }, x \in C\}$ is connected (as a (non-empty, as the connected set $\{x\}$ is one of the $C$ we use) union of intersecting connected sets) and is clearly maximal, so $C_x$ is a component of $X$ that contains $x$.
Let $\mathscr{C}(X)$ be the set of components of $X$, and let $h: X \to Y$ be a homeomorphism.
Then the induced map $\bar{h}: \mathscr{C}(X) \to \mathscr{C}(Y)$ can be defined by $\bar{h}(C)=h[C] \subseteq Y$ (just the image set under $h$)
$\bar{h}(C)$ is connected as the continuous image of a connected set. And if $\bar{h}(C) = h[C] \subseteq C' \subseteq Y$ and $C'$ is connected, then $C\subseteq h^{-1}[C']$ and the latter set is connected (as $h^{-1}$ is continuous too) and so maximality in $X$ tells us that $C= h^{-1}[C']$ or $\bar{h}(C) = C'$ (applying the bijective $h$ to both sides). So indeed $\bar{h}(C) \in \mathscr{C}(Y)$.
$\bar{h}$ has the same induced map based on $h^{-1}$ as its inverse so we have a bijection between $\mathscr{C}(X)$ and $\mathscr{C}(Y)$ so in particular the number (cardinality) of their components, call it $\textrm{nc}(X)$, say, is the same.
So $$X \simeq Y \implies \operatorname{nc}(X) = \operatorname{nc}(Y)$$ which can be used in its contrapositive form
$$\operatorname{nc}(X) \neq \operatorname{nc}(Y) \implies X \not\simeq Y$$
to show spaces are non-homeomorphic.
In your argument you also implicitly use the following fact:

If $X \simeq Y$ by a homeomorphism $h$, then $X\setminus \{p\} \simeq Y \setminus \{h(p)\}$ for any $p \in X$.

the proof of which is trivial.
