# 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