Math Help - Construct an explicit bijection from (0,1) to [0,1]

1. Construct an explicit bijection from (0,1) to [0,1]

Construct an explicit bijection from the open interval (0,1) to the closed interval [0,1].

2. Originally Posted by qtpipi

Construct an explicit bijection from the open interval (0,1) to the closed interval [0,1].
how about this: $f(x) = \begin{cases} 0 & x = \frac{1}{2} \\ \frac{1}{n-2} & x =\frac{1}{n} , \ n \geq 3, \ n \in \mathbb{N} \\ x & \text{otherwise} \end{cases}.$