What is a continuous function on the rationals that hasn't a continuous extension on the reals? In a review of H.R. Pitt's Integration, Measure and Probability, Sir John Kingman wrote,

The author is often careless about details, asserting for instance (on page 105) that a function continuous on the rationals has a continuous extension to the reals.

Using the properties of Cauchy sequences and completeness of $\mathbb R$, I can prove that if $f:\mathbb Q\to\mathbb R$ is uniformly continuous, then there exists a continuous function $g:\mathbb R\to\mathbb R$ such that $f=g$ on $\mathbb Q$.
It follows that any inextensible $f$ cannot be uniformly continuous on $\mathbb Q$. However, I am unable to come up with a concrete example.
 A: The restriction of the composition of $ℝ → ℝ,~x ↦ x - \sqrt 2$ and $ℝ\setminus \{0\} → ℝ,~x ↦ 1/x$ to the rationals has no extension to $ℝ$, that is the map
$$ℚ → ℝ,~x ↦ \frac 1 {x - \sqrt 2}.$$
A: Let $f(x) = 0$ if $x<\pi$, and $f(x) =1$ otherwise. Since every rational has a positive distance from $\pi$, this function is continuous on the rationals. It clearly cannot be extended to a continuous function on the reals. 
A: Consider the function $f$ sending every rational $<\pi$ to $0$ and sending every rational $>\pi$ to $1$. 
As a function from $\mathbb{Q}$ to $\mathbb{Q}$ (with the usual metric/topology on $\mathbb{Q}$) this is continuous: for every rational $a$, we can take a small enough positive $\epsilon$ so that $\pi\not\in (a-\epsilon,a+\epsilon)$ and then $f$ is constant on this interval. But it obviously has no continuous extension to all of $\mathbb{R}$.

Some remarks:


*

*The key point re: continuity is the fact that $\pi$ is not rational: if we try to do the same thing replacing $\pi$ with $17$, the continuity claim breaks down (take $a=17$).

*Meanwhile, the key point re: nonextendibility - which I didn't justify, since it's "obvious" - is that there are rationals arbitrarily close to $\pi$. If I had a "big gap" instead of a "single missing point," I'd have "room" to "connect everything up nicely" (yay scarequotes!).
And the above observations together point at the relationship between $\mathbb{R}$ and $\mathbb{Q}$.
