This may seem like a tricky question at first because there may seem to be not enough "space" to fit

into
)
, but actually there is more "space" than you think. Let
_{n=1}^{\infty})
be a sequence of distinct elements contained in the interval

where

and let

. Define the function
)
,
\begin{align*}
f(x) = \begin{cases} x_{n+1} & \text{if \ } x \in M \\ x & \text{if \ } x \in [0,1] \setminus M.\end{cases}
\end{align*}
To show that

is injective, we consider the following three cases:
1) Let

. Note that
)
and
)
are both elements of

. Since

only consists of distinct elements, then

implies
 \neq f(a_2))
.
2) Let

,

. Note that
 \in M)
and
 = a_2 \in [0,1] \setminus M)
. Thus, if

then
 \neq f(a_2))
.
3) Let

. Note that
 = a_1)
and
 = a_2)
, so if

then
 \neq f(a_2))
.
To show that

is surjective, we need to show that the range of

is equal to
)
. The range of the function
=x_{n+1})
,

, is

and the range of the function
 = x)
,

, is
 \setminus \{x_{n+1}, n \in \mathbb{N}\})
. Since

is a piecewise function of

and

, its range must be precisely
)
and we are done.
EDIT: Don't know what's up with AN's latex typeset, it's way different and very non-standard from back in the days I used it lol.