# Continuity of a piecewise function on the irrationals.

I have a function defined as follows: Let $t=\frac{p}{q}$ be fully reduced for $t\in \mathbb Q$

$$f(t)=\left\{ \begin{array}{lll} 1/q & \text{if} & t\in\mathbb Q\\ 0 & \text{if} & t\in\mathbb R\setminus\mathbb Q \\ 1 & \text{if} & t = 0 \end{array} \right.$$

I have proved that the given function is not continuous for $t \in \mathbb Q$ but I'm having trouble proving that for $t \in \mathbb R \setminus \mathbb Q$ the function is continuous.

Can someone point me in the right direction? I'm thinking about using a decimal approximation for $t \in \mathbb R \setminus \mathbb Q$ but I don't know where to go.

• $x$ is $t$, right? – user67133 Nov 5 '13 at 0:00
• Yeah, oops! Fixed that. – druckermanly Nov 5 '13 at 0:03

A bit more formally, given $\epsilon>0$, an irrational number $x$, and any rational number $p/q$ such that $|p/q-x|<\epsilon$, then $q\rightarrow\infty$ as $\epsilon\rightarrow 0$.
• I tried to do so, but I'm stuck trying to prove that the denominator of a rational approximation of an irrational number is monotone increasing. I know that I can say it will tend towards $\infty$, but the monotone part is where I'm stuck. – druckermanly Nov 5 '13 at 0:59
• @user2899162 It doesn't really need to be monotone, as long as the smallest denominator in the $\epsilon$ ball is still diverging to $\infty$. The basic idea is that if $M$ is the smallest denominator in a given ball, then all rationals with denominator at most $M$ are a minimum non-zero distance away from the irrational point. So you move into the corresponding small ball and get denominators all at least $M+1$. Rinse and repeat. In this sense you get a monotonically increasing sequence of "smallest denominators", I guess. – zibadawa timmy Nov 6 '13 at 0:31