TITLE: Find a bijective mapping that shows that [0,1] and [0,1) have the same cardinality
QUESTION [6 upvotes]: I need to show that the two sets $[0,1]$ and $[0,1)$ have the same cardinality. I know that in order to show this I must show that there exists $f$ such that $f:[0,1]\to[0,1),$
but I am not sure how to proceed.
Any help would be appreciated. Thanks.

REPLY [5 votes]: These sorts of things often boil down to using the fact that there is a bijection between the nonnegative integers and the positive integers, allowing you to shift everything over by one to make room for an extra point (e.g. the Hilbert hotel paradox); you just need to find a suitable copy of $\mathbb{N}$ in the problem.
In fact, we can completely characterize the bijections:
Lemma: every bijection between $[0,1]$ and $[0,1)$ can be uniquely expressed as:

An injection $g : \mathbb{N} \to [0,1)$
A bijection $h : [0,1) \setminus g(\mathbb{N}) \to [0,1) \setminus g(\mathbb{N})$

and conversely, given such data, there there is a corresponding bijection
$$ f : [0,1] \to [0,1) : x \mapsto
\begin{cases}
g(0) & x = 1 
\\ g(g^{-1}(x) + 1) & x \in g(\mathbb{N})
\\ h(x) & x \in [0,1) \setminus g(\mathbb{N})\end{cases} $$