## A characterization of continuity

Yesterday, Randall Holmes mentioned to me the following nice characterization of continuity for functions between Euclidean spaces.

Theorem. A function $f:{\mathbb R}^n\to{\mathbb R}^m$ is continuous iff it preserves path-connectedness and compactness.

This is an easy exercise, but I don’t remember having seen the characterization before, so I figured I could as well write down the argument I found. It is clear that the result holds for a much wider class of spaces than the ${\mathbb R}^n$, but to keep this post simple, I’ll just leave it this way.

Proof. For Euclidean spaces, continuity and sequential continuity coincide. Towards a contradiction, assume $x_i$ converges to $x$ but $f(x_i)$ does not converge to $f(x)$.

• Case 1. The range of $\{f(x_i): i\ge 0\}$ is infinite.

This quickly leads to a contradiction since $\{f(x_i):i\ge 0\}\cup\{f(x)\}$ is a compact set: We may as well assume that the map $i\mapsto f(x_i)$ is injective, and since $f(x_i)$ does not converge to $f(x)$ we may in fact assume that all the $f(x_i)$ stay away from $f(x)$. The set $\{f(x_i):i\ge 0\}$ has an accumulation point, which cannot be $f(x)$ so it must be $f(x_m)$ for some $m$. But then the set $\{f(x_i):i>m\}\cup\{f(x)\}$ is both compact and lacks one of its accumulation points, contradiction.

• Case 2. The range is finite.

We may as well assume all $x_i$ have the same image. Fix paths $A_i=[x_i,x_{i+1}]$ in ${\mathbb R}^n$ that we can combine to get a path $\bigcup_i A_i\cup\{x\}$ (for example, $A_i$ could simply be a segment). By preservation of path connectedness, any $A_i$ with range of size at least 2 in fact has range of size continuum. If infinitely many of the $A_i$ have infinite range, one easily reduces to Case 1. So we may assume all the $A_i$ have constant range, but then $\bigcup_i A_i\cup\{x\}$ has a disconnected image. ${\sf QED}$