Find a function continuous at a single point of an interval, but discontinuous at all other points of the interval.
Consider the interval for any , and define
for all .
We claim is continuous at 0, but discontinuous at every other point of the interval.
Proof. First, we show is continuous at 0. To do this we must show that for all there exists a such that whenever . So, let be given. Then, choose . Then we have,
since from the definition of . Thus, is continuous at 0.
Now, we must show is discontinuous at every other point of the interval. Let be any nonzero point of the interval.
We consider two cases:
Case #1: is rational. Then . Since by assumption, we consider . Since the irrationals are dense in the reals (see Exercise #9 of Section I.3.12 here) we know that for any there is some irrational number such that . But then, . This means is not continuous at since we have found an such that there is no we can choose such that whenever .
Case #2: is irrational. Since is irrational we know . Consider . Since the rationals are dense in the reals (see Exercise #6 of Section I.3.12 here) we know that for any there exists some rational number such that . But then, . This means is not continuous at . (Again, because we have shown that there exists an such that for every there is some number such that with
(Note: There are much nicer ways to do this using sequences, but Apostol doesn’t develop those techniques, so we have to work straight from the epsilon-delta definitions.)