# Continuity question

1. Feb 5, 2009

### kidsmoker

Hi.

In the book i'm reading it gives the function

f(x) = 0, if x is irrational
f(x) = 1/q, if x=p/q in lowest terms.

It says this is continuous at all irrational x. This i can understand i think, because you can show that f(x) tends to zero, as x tends to a, for all a. For this you just take epsilon to be the distance from a to the closest rational number. It can be seen from the graph:

http://img80.imageshack.us/img80/7246/26351357js6.jpg [Broken]

Then they give the function

f(x) = 0, if x is irrational
f(x) = x, if x is rational.

But they say this is discontinuous at all values of x other than x=0. I don't really understand why this is the case. How come you can't use the same argument as above to show that f(x) tends to zero, as x tends to a, for all a again?

Thanks!

Last edited by a moderator: May 4, 2017
2. Feb 5, 2009

### Office_Shredder

Staff Emeritus
This doesn't exist

To show that the first function is continuous, you have to notice that for every epsilon, there exists n such that 1/n<epsilon. Then there are only finitely many rationals that are 'near' (say within distance 1) an irrational x with denominator less than or equal to n, so if you pick some d smaller than the distance to the closest one of those, then

|x-y|<d implies f(y) = 1/q for some q larger than n (since if y is rational, we constructed d to force y to have a larger denominator) or f(y)=0 if y is irrational. Hence |f(x)-f(y)| = |f(y)| < 1/n < epsilon in either case. Hence f is continuous at every irrational point.

3. Feb 5, 2009

### HallsofIvy

Staff Emeritus
Actually, what you can show is that the limit is 0 at all real values of x. That is because, given any $\epsilon> 0$, there exist only a finite number of denominators q such that p/q is within $\epsilon$ of any given x, so, as $\epsilon$ goes to 0, both p and q must go to infinity. Since for x rational, f(x)= x, the limit, 0, is equal to the value of the function if and only if x= 0.

4. Feb 5, 2009

### kidsmoker

Okay yeah I understand it better now.