Background Problem: I was trying to show that if $f:X\to Y$ is a continuous surjective map for $X,Y$ some topological spaces, then we have that: $X$ is path-connected $\implies$ so is $Y$. I was able to prove this in exactly same way as discussed here.
Context: However, since this problem appears in tom Dieck's Algebraic Topology book and the functor, $$\pi_0:\textbf{Top}\to \textbf{Set},X\mapsto \pi_0(X)$$ where $\pi_0(X)$ is the set of path components of $X$ and the induced map $\pi_0(f:X\to Y)$ is the set map $\pi_0f:\pi_0(X)\to \pi_0(Y)$ that maps the equivalence class (ie path component) of $x\in X$ to the equivalence class of $f(x)\in Y$, ie $\pi_0 f([x])=[f(x)]$.
I know that since functors preserve isomorphisms, if $f$ is a homeomorphism, then the induced map $\pi_0f$ is a bijection of the sets $\pi_0(X)$ and $\pi_0(Y)$. Hence, $\pi_0(X)$ and $\pi_0(Y)$ have the same cardinality. Thus we can say that size/cardinality of $\pi_0(X)$ is a topological invariant.
Question 1: Is it possible to show that given any continuous $f:X\to Y$ that $\pi_0(X)$ and $\pi_0(f(X))$ have the same cardinality?
I believe to do this, it would be sufficient to show that given $f$ is surjective, $\pi_0f$ is surjective and try to use some set theoretic result such as: $A\to B$ is a surjective set map $\implies$ $|A| \geq |B|$, where $|X|$ is cardinality of set $X$. But I am not sure of the set theory thing.
I know very little about cardinalities, any suggestions here will be helpful. I am not necessarily looking to avoid using the Axiom of Choice.
Question 2: Here is my proof that if $f:X\to Y$ is surjective then $\pi_0f$ is surjective, I would like to know if this okay?
Let $[z]\in \pi_0(Y)$. Then, $z\in Y$, since $f$ is surjective, $z=f(x)$ for some $x\in X$. Hence, $[z]=[f(x)]=:\pi_0f([x])$. Hence, for every element $[z]$ in $\pi_0(Y)$, there is an element in $\pi_0(X)$ that gets mapped under $\pi_0f$ to $[z]$. Hence, $\pi_0f$ is surjective.
Answer to the background problem: Using the statement above, $\pi_0f:\pi_0(X)\to \pi_0(Y)$ is a surjection. Given $X$ is path connected, we have $\pi_0(X)=\{*\}$. Hence, $\pi_0(Y)$ is also a singleton, implying that $Y$ is path connected.
Any suggestions will be greatly helpful :))