Let f: R -> R be defined by f(x) = 0 if x is rational, x if x is irrational. Show that lim x->0 f(x) = 0 but lim x->x0 f(x) does not exist for x0 != 0.

Epsilon-delta proofs are welcome along with equivalent arguments using sequences.

what you are essentially proving is that f is continuous at 0 but nowhere else. alright, here goes:

Proof:
(i) At x=0, f is continuous. For if we let e > 0, we can choose d = e, and then if |x - 0| = |x| < d, then |f(x) - f(0)| = |f(x)| is either 0 for x in Q or |x| for x not in Q. In the former case, we have |f(x)| = 0 < e, and in the latter we have |f(x)| = |x| < d = e, so we are done.

If x is in Q and x > 0, then we are sure that there is some y in the interval (x, x+d) such that y is not in Q, so that f(y) = y. If x < 0, we can similarly choose a y in the interval (x-d, x). Either way, for this y we have |x-y| < d, yet |f(x) - f(y)| = |0 - f(y)| = |f(y)| = |y| > |x| = e, so f is not continuous at x.

If x is not in Q, then we are sure that there is some y in the interval (x-d, x+d) such that y is in Q, so that f(y) = 0. But for this y, we have |x-y| < d, yet |f(x) - f(y)| = |f(x)| = |x| = e, so f is not continuous at x.

what you are essentially proving is that f is continuous at 0 but nowhere else. alright, here goes:

Proof:
(i) At x=0, f is continuous. For if we let e > 0, we can choose d = e, and then if |x - 0| = |x| < d, then |f(x) - f(0)| = |f(x)| is either 0 for x in Q or |x| for x not in Q. In the former case, we have |f(x)| = 0 < e, and in the latter we have |f(x)| = |x| < d = e, so we are done.

If x is in Q and x > 0, then we are sure that there is some y in the interval (x, x+d) such that y is not in Q, so that f(y) = y. If x < 0, we can similarly choose a y in the interval (x-d, x). Either way, for this y we have |x-y| < d, yet |f(x) - f(y)| = |0 - f(y)| = |f(y)| = |y| > |x| = e, so f is not continuous at x.

If x is not in Q, then we are sure that there is some y in the interval (x-d, x+d) such that y is in Q, so that f(y) = 0. But for this y, we have |x-y| < d, yet |f(x) - f(y)| = |f(x)| = |x| = e, so f is not continuous at x.

In either case, f is not continuous at x.

////

Very nice, thank you. We actually have not learned the definition of continuity yet in my class, so I didn't make that connection when taking the test, but after reading the definition and then your proof it all makes sense.