# limits and continuity: irrational and rational piecewise function

I have noticed similar topics, but people seem to solving them with sequences which I have not learned yet.

I need to prove that the function:

$$f(x)=\begin{cases} x, & \text{ if x is an irrational number }\\0 & \text{ if x is a rational number }\end{cases}$$

is discontinuous at every irrational number using both the precise definition of a limit and the fact that every nonempty open interval of real numbers contains both irrational and rational numbers.

While I generally understand the $\epsilon-\delta$ definition, I'm having trouble applying it to this question and finding the appropriate epsilon to use.

• Think of it this way, no matter how close we get to any irrational number, x, there will always be a rational number, q, that is closer to x such that the distance between f(x) and f(q) ≥ x. We never reach our goal... – user237393 May 7 '15 at 16:44
• Hint. You can find a sequence of rational numbers that approaches $\sqrt{2}$. What is the limit if you apply $f$ to that sequence? – Ethan Bolker May 7 '15 at 16:46
• @user237393 I understand that there is an unlimited number of rational/irrational numbers in any interval, I am struggling with how to demonstrate that via the epsilon delta definition. – abstractbryan May 7 '15 at 16:49
• And @Ethan Bolker I cannot use sequences, because we have not covered them yet. – abstractbryan May 7 '15 at 16:49
• Perhaps you can turn what you figure out using sequences into an $\epsilon - \delta$ proof. – Ethan Bolker May 7 '15 at 16:53

Let $a$ be irrational, so $f(a)=a\ne0$. Let $\epsilon=|a|$ and assume there is $\delta>0$ such that $|f(x)-f(a)|<\epsilon$ for all $x$ with $|x-a|<\delta$. By the existence of rationals $x$ with $|x-a|<\delta$ (for example $x=\frac1n\lfloor n a\rfloor$ for $n\in\mathbb N$ with $n>\frac1\delta$) we arrive at a contradiction because for this $x$ we have $f(x)=0$ and hence $|f(x)-f(a)|\not<\epsilon$.