About number of connected components I want to show that $\mathbb{R}$ is not homeomorphic to the set
$A=\{z\in\mathbb{C}\mid z^3\in\mathbb{R}^{+}\cup \{0\}\}$ by using contradiction.
Assume there is homeomorphism $f$ from $A$ to $\mathbb{R}$ and $f(0)=a$ for some point $a \in \mathbb{R}$. If I remove the origin point from $A$, I will get $3$ connected components left and a homeomorphism $f'$ from $A-\{0\}$ to $\mathbb{R}-\{a\}$. However, for every point $a \in \mathbb{R}$, the set $\mathbb{R}-\{a\}$ has only $2$ connected components.
I think this should contradict the fact that $f'$ is a homeomorphism.
Is it true that number of connected components is preserved? Why? What about when $f'$ is just a continuous map?
 A: If $f \colon A \to B$ is a homeomorphism, then for every $p\in A$, the restriction $f_p \colon A\setminus\{p\} \to B\setminus\{f(p)\}$ is also a homeomorphism, hence preserves the number of connected components.
If $f$ is merely continuous, all that we know is that it doesn't increase the number of connected components, i.e. $f(A) \subset B$ has at most as many connected components as $A$ does. That follows because the image of a connected set under a continuous map is connected, so if $$A = \bigcup_{\iota\in I} C_\iota$$
is a decomposition of $A$ into connected components, then
$$f(A) = \bigcup_{\iota\in I} f(C_\iota)$$
is a representation of $f(A)$ as a union of connected sets with as many members as $A$ has connected components. But the $f(C_\iota)$ need not be connected components of $f(A)$, unless $f$ is a homeomorphism. The union of two distinct $f(C_\iota)$ can be connected, even if the two are disjoint.
So, if $f$ is a homeomorphism we know that $f(A) = B$ has at most as many connected components as $A$ has by the continuity of $f$, and the continuity of $f^{-1}$ implies that $A = f^{-1}(B)$ has at most as many connected components as $B$, hence the (cardinal) numbers are equal.
