# Proving a function in bounded on a subinterval

Let $k:[0,1] \to \mathbb{R}$ be the map such that $k(x):=0$ if $x=0$ and if $x \in [0,1]$ is irrational and $k(x):=n$ if $x \in [0,1]$ with $x = m/n$ for some coprime integers $m,n$. Show that $k$ is not bounded on any subinterval $[c,d]$ with $0 \leq c < d \leq 1$.

I am not sure how to show this. My first thought is to proceed by contradiction but I am unsure of how assuming the function is bounded is helpful.

We want to show that given any positive $B$, there is a fraction $\frac{m}{n}$ in lowest terms between $c$ and $d$ such that $n\gt B$.
Let $n$ be a power of $2$ which is larger than $B$ and has the property that $\frac{1}{n}\lt \frac{d-c}{4}$. Then there are two consecutive integers $l$ and $l+1$ such that both $\frac{l}{n}$ and $\frac{l+1}{n}$ are between $c$ and $d$. One of $l$ or $l+1$ is odd. Call it $m$. Then $\frac{m}{n}$ is in lowest terms, between $c$ and $d$, and $k(m/n)=n\gt B$.
• Here $n$ is automatically positive, since it is a power of $2$. – André Nicolas Nov 2 '15 at 5:18