Suppose $f : \mathbb{R} \to \mathbb{R}$ is a continuous function such that $f(\mathbb{Q}) \subseteq \mathbb{N}$. Show that $f$ is constant.
--Skip this section if you want--
As this site disallows effortless questions, I'm adding my solution to this problem without going into too much detail:
- Suppose $\exists \ r \in \mathbb{R} \backslash \mathbb{Q}$ such that $f(r) \notin \mathbb{N}$. Pick a sequence of rational numbers $\{q_i\}_{i \in \mathbb{N}} \to r$. By sequential definition of continuity, $\{f(q_i)\}_{i \in \mathbb{N}} \to f(r) \implies f(r) \in \mathbb{N}$ (which can be shown using the definition of convergence).
- Now that we know $f(\mathbb{R}) \subseteq \mathbb{N}$, pick $x, y \in \mathbb{R} \ (x < y)$ and observe that by the intermediate value theorem (IVT), $\exists \ z \in (x,y)$ such that $f(z) \in \text{img}(f) \cap \mathbb{R} \backslash \mathbb{N} \equiv \phi$. This gives us that $f$ is constant.
I request someone to help me solve this without using the definition of sequential continuity or anything taught above the high-school level. More specifically, a proof that uses the IVT and continuity is alright as long as theorems related to introductory real-analysis (despite the tags below) are not involved.
The function $f:[0,1]\to\mathbb R$ is uniformly continuous, so there exists $\delta_0>0$, such that when $x,y\in[0,1]$ and $|x-y|<\delta_0$, we have $$|f(x)-f(y)|<1. \tag{*}$$ Choose $$0=x_0<x_1<x_2<\cdots<x_N=1$$ such that $$\max_{1\leq k\leq N}(x_k-x_{k-1})<\delta_0.$$ So when $x,y\in[x_{k-1},x_k]\cap\mathbb Q$, by $(*)$, we have $f(x)=f(y)$. i.e. $$f(x)\equiv C_k,\quad \forall x\in[x_{k-1},x_k]\cap\mathbb Q.$$
This implies $$f(x)\equiv C_k,\quad \forall x\in[x_{k-1},x_k].$$ Hence (note that $C_{k}=f(x_k)=C_{k+1},k=1,2,\cdots,N-1$) $$f(x)\equiv f(0),\quad \forall x\in[0,1].$$
Similarly,we can conclude that $$f(x)\equiv D_n,\quad \forall x\in[n-1,n],n\in\mathbb Z.$$ Due to $$D_{n}=f(n)=D_{n+1},\quad \forall n\in\mathbb Z,$$ we have $$f(x)\equiv f(0),\quad \forall x\in\mathbb R.$$