Continuous Extensions on Dense Subspaces

metric-spacesreal-analysis

I thought that if I have a function $f: \mathbb Q \to \mathbb R$ that is continuous then I can (uniquely) extend it to a continuous function $F: \mathbb R \to \mathbb R$ as follows: for $r \in \mathbb R \setminus \mathbb Q$ pick a sequence $q_n$ converging to $r$ and then define $F(r) = \lim_{n \to \infty} f(q_n)$.

So I thought there must be a theorem saying that given a continuous function $f: D \to Y$ where $D$ is a dense subset of a metric space $X$ one can uniquely extend it to $F: X \to Y$.

Instead I found a theorem stating this but with the additional requirement that $f$ has to be uniformly continuous. Now I'm confused: is my example above wrong? Where does uniform continuity come in here?

Thanks.

Best Answer

Uniform continuity ensures that the Cauchy sequence $(q_n)$ in $\mathbb Q$ is mapped to a Cauchy (and hence convergent) sequence $\bigl(f(q_n)\bigr)$ in $\mathbb R$. If $f$ is just continuous, $\bigl(f(q_n)\bigr)$ needn't converge (remember: $f$ is just continuous on $\mathbb Q$, so you can't argue, that convergent sequences $q_n \to r \not\in\mathbb Q$ are mapped onto convergent sequences by $f$). For example $x\mapsto \frac 1{x - \sqrt 2}$ is continuous (not uniformly!) on $\mathbb Q$ and can't be extendend.

In fact, you only need the property, that Cauchy sequences are mapped to Cauchy sequences, which is a little weaker than uniform continuity, and a little stronger than continuity (for some properties of such functions, see here for start).

Related Question