On pages 8 and 9 of Topology from the differentiable viewpoint, Milnor proves the fundamental theorem of algebra. He does so by first turning our polynomial $P:\mathbb{C} \rightarrow \mathbb{C}$ into a function $f:\hat{\mathbb{C}} \rightarrow \hat{\mathbb{C}}$ on the Riemann sphere. But, I don't see why moving to $\hat{\mathbb{C}}$ is necessary. Here's the argument:
Next observe that $f$ has only a finite number of critical points; for $P$ fails to be a local diffeomorphism only at the zeros of the derivative polynomial $P$ and there are only finitely many zeros since $P'$ is not identically zero. The set of regular values of $f$, being a sphere with finitely many points removed, is therefore connected. Hence the locally constant function $\#f^{-1}(y)$ must actually be constant on this set. Since $\#f^{-1}(y)$ can't be zero everywhere, we conclude that it is zero nowhere. Thus $f$ is an onto mapping, and the polynomial $P$ must have a zero.
I don't see why we can't just apply this argument to $P$ directly. After all, a plane with finitely many points removed is still connected; this property isn't unique to the sphere.
Question. If we try to replace $f$ with $P$ in Milnor's proof, what goes wrong?
Consider $\exp \colon \mathbb{C}\to \mathbb{C}$. This has only finitely many critical points (none, to be exact), hence the set of regular values is connected (it's $\mathbb{C}$). Yet $\exp$ is not surjective. The cardinality-of-preimage function isn't locally constant in that case. To have the local constantness of $\# f^{-1}(y)$, you need the closedness of $f(M)$, and for that, compactness of the domain is useful.