Let $A = \{(x,y) \in \mathbb{R}^2 : x = 0 \text{ or } y = 0\}$ equipped with the subspace topology from $\mathbb{R}^2$. Let $f:\mathbb{R}\to A$ be a surjective and continuous map. Prove that $f^{-1}((0,0))$ is infinite.
Since $f$ is continuous, by the EVT, it has a maximum and minimum on any compact subset of $A.$ For a contradiction, assume that $f^{-1}((0,0))$ is bounded and let a and b be the minimum and maximum of $f^{-1}((0,0))$. It could be useful to determine what $f((-\infty, a)), f([a,b]), f((b,\infty))$ could be. I know that continuous functions map connected sets to connected sets, so the above sets are all connected. Also, I know that continuous functions map compact sets to compact sets. How can one get a contradiction from here?
Hint: you are along the right lines. $f[[a, b]]$ is a compact and hence bounded subset of $A$, while $f[(-\infty, a)]$ and $f[(b, \infty)]$ are connected subsets of $A \setminus \{(0, 0)\}$. So $A$ is the union of a bounded subset and two sets both of which are contained in one of the four connected components of $A \setminus \{(0, 0)\}$. As each of those connected components is unbounded, such a union cannot be all of $A$.