[Math] continuous function from $\mathbb{Q}$ to $\mathbb{R}$

continuity

Is there exist continuous function from $\mathbb{Q}$ to $\mathbb{R}$?

if such continuous function exist and contain more than one point then by intermediate value theorem contains uncountable points which is not possible f($\mathbb{Q}$) is atmost countable.

hence must be constant function

Let f($\mathbb{Q}$)=$\{a\}$ but singleton is closed in $\mathbb{R}$ and under continuous function inverse image of closed set is closed.Here inverse image of {a} is $\mathbb{Q}$. But $\mathbb{Q}$ is not closed hence there doesnot exist any continuous function from $\mathbb{Q}$ to $\mathbb{R}$.

please correct me if i am wrong

Best Answer

Since $\Bbb Q$ is a subspace of $\Bbb R$, any continuous function $\Bbb R\to\Bbb R$, such as the identity $f(x)=x$, will be continuous when restricted to $\Bbb Q$.