Could someone verify my answer? Am i correct?
Question: Show a bijection from $[0,1]$ (closed) into $(0,1)$ (open)
Answer: Define a sequence $X = \{x_{n}\}_{x\in\mathbb{N}}$ by $ x_{n} = \frac{1}{(2n-1)}$ such that $X \subset [0,1]$ and a sequence $ Y = \{y_{n}\}_{y\in\mathbb{N}}$ by $ y_{n} = \frac{1}{2} - \frac{1}{2^n}$ such that $ Y \subset [0,1] $. Then we have $ X = \{1, \frac{1}{3}, \frac{1}{5}, ... \} $ and $ Y = \{ 0, \frac{1}{4}, \frac{3}{8}, ...\} $. We see $ X \cap Y = \emptyset $. Define a function $ f: X \rightarrow (0,1)$ such that $ f(x_{n}) = x_{n+1}$ and a function $ g: Y \rightarrow (0,1)$ such that $ g(y_{n}) = y_{n+1} $.
Now we can construct a function $ h: [0,1] \rightarrow (0,1) $ such that:
$$ h(z) = \begin{cases}
f(z), \text{if} \quad z \in X \\
g(z), \text{if} \quad z \in Y \\
z, \text{if} \quad z \in [0,1] \setminus (X \cup Y )
\end{cases} $$
That function is bijective.
This is close. You want $y_0=0$ but your expression does not give that. As you say, that is now fixed.