Let $f$ be a continuous function $f:\Bbb Q\to \Bbb Q$. Does there exist a continuous function $g:\Bbb R\to \Bbb R$, such that restriction of $g$ to $\Bbb Q$ is $f$?
-
2You don't need $g$ to be continuous? – user160738 Dec 12 '16 at 11:36
-
10If you want $g$ continuous, not always: take $f(q)=0$ if $q<\sqrt{2}$, $f(q)=1$ otherwise. The term Cauchy-continuous function should be of relevance. – Wojowu Dec 12 '16 at 11:36
-
It is sufficient that $f$ be uniformly continuous for instance. It doesn't work in all generality. – Olivier Moschetta Dec 12 '16 at 11:37
-
@OlivierMoschetta Uniformly continuous on bounded intervals is weaker and suffices too. – egreg Dec 12 '16 at 12:00
1 Answers
In general no. Consider the function $f:\mathbb{Q}\rightarrow \mathbb{Q}$ defined by $f(x)=\lfloor\pi (x^2+1)\rfloor$. $f$ cannot be extended to a continuous function from $\mathbb{R}\rightarrow \mathbb{R}$.
The function $\lfloor x \rfloor:\mathbb{R}\rightarrow \mathbb{R}$ is only discontinuous at integers. For any rational number $x$, as $\pi$ is an irrational number, $\pi(x^2+1)$ is not an integer. Hence $f$ is continuous at all rationals.
The function $f$ cannot be extended to $\mathbb{R}$, as we can find two sequences of rationals $s_n$ and $t_n$ converging to $\sqrt{\frac{4}{\pi}-1}$ such that $\lim_{n\rightarrow \infty}f(s_n)=3$ and $\lim_{n\rightarrow \infty}f(t_n)=4$. Hence any extension of $f$ will be discontinuous at $\sqrt{\frac{4}{\pi}-1}$.
- 819