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.