# Is this the correct counter example?

I encountered the following problem in Berkeley problems in Mathematics:

(Sp84): Prove or supply a counterexample: If the function $f$ from $\mathbb{R}$ has both a left limit and a right limit at each point of $\mathbb{R}$, then the set of discontinuities of $f$ is, at most, countable.

I found the book claimed this is right. But I have the following counterexample:

Let $f=0$ at $\mathbb{R}$ except at the cantor set. And let $f=1$ at the cantor set. Then $f$ has both a left limit and a right limit at every point in $\mathbb{R}$. But the set of discontinuities is the cantor set, whose cardinality is equal to $c$.

This should make sense since the Cantor set is nowhere dense, and the left/right limit at every point should be 0. I just do not know why this counterexample does not make sense - or maybe the book means all non-removable discontinuities?

-
No, I mean any point in the Cantor set has a neighborhood where there is no more Cantor sets. Thus $f$'s left or right limit at this point should be 0. – Bombyx mori Jun 16 '12 at 22:04
@rotskoff: That's not accurate; for the function to be continuous, you need the limit to exist and to agree with the value of the function. – Arturo Magidin Jun 16 '12 at 22:08
My function is not continuous on the Cantor set. Otherwise it is continuous. – Bombyx mori Jun 16 '12 at 22:08
The counterexample does not work, because the points of Cantor set are not isolated. For each $x\in C$ at least one of the one-sided limits at $x$ does not exist. – user31373 Jun 16 '12 at 22:11

It’s true that your function is discontinuous at each point of the Cantor set, but there is no point of the Cantor set where it has both a left and a right limit. It has a left limit only at the right endpoints of the open intervals that were removed in the construction of the middle-thirds Cantor set, and it has a right limit only at the left endpoints of those intervals. These two sets are disjoint. Moreover, both are countable, so at most points of the Cantor set the function has neither a left nor a right limit.

-
I see. This makes sense after double checking with Wikipedia. – Bombyx mori Jun 16 '12 at 22:15