TITLE: How discontinuous does a $[a,b] \to (c,d)$ bijection have to be?
QUESTION [6 upvotes]: I know that bijection from $[a,b]$ to $(c,d)$ can't be continuous, but I'm wondering if such a function could exist if it was discontinuous at just countable points, and if this isn't possible, why?

REPLY [8 votes]: The function $f:[0,1]\to [0,1)$ given by
$$
f(x) = \cases{\frac x2 & if $x = \frac{1}{2^n}$ for some $n\in \Bbb N$\\ x & otherwise}
$$
is the standard example of a bijection $[0,1]\to [0,1)$ and it is discontinuous only at a countable number of points. It can also without too much work be altered to fit $[a, b]\to(c, d)$ without losing that property.

REPLY [3 votes]: Such functions exist.  For simplicity, I'll map the interval $[-1,1]$ to $(-1,1)$, but the technique works in the general case.
For $n \geq 1$, let $a_n = \frac{1}{n}$ and $b_n = -\frac{1}{n}$.  Define $f\colon\thinspace [-1,1]\rightarrow (-1,1)$ as follows:
-For values in the sequence $a_n$, $f(a_n) = a_{n+1}$.
-For values in the sequence $b_n$, $f(b_n) = b_{n+1}$.
-For all other $x$, $f(x) = x$.
One can easily verify that $f$ is a bijection from $[-1,1]$ to $(-1, 1)$.  And it is continuous everywhere except on the sequences $\{a_n\}$ and $\{b_n\}$, which are countably many points.