I am supposed to construct a bijective function for the interval: \begin{align} I_2=\left(-\frac{\pi}{2} ,\frac{\pi}{2} \right] \longrightarrow \mathbb{R} \tag{Problem} \end{align} I first tried the easier case, i.e. \begin{align}f_1:I_1=\left(-\frac{\pi}{2} ,\frac{\pi}{2} \right) &\longrightarrow \mathbb{R} \\ x& \longmapsto \tan(x) \end{align} which is a bijection. Now I know that the composition of bijective functions is still a bijection. Which means that it should be possible to 'make room' for the missing point $\pi/2$. The following function: \begin{align}\phi : \mathbb{R} &\longrightarrow \mathbb{R \setminus}\lbrace 0 \rbrace \\ x & \longmapsto \begin{cases}x+1 \ \text{if} \ x \in \mathbb{N}_0 \\x \ \text{otherwise} \end{cases}\end{align} would be bijective, such that the composition $\phi \circ f_1: I_1 \rightarrow \mathbb{R}\setminus \lbrace 0 \rbrace $ is bijective, and as desired it now has room for a point that I can map to.
At this point I am not sure if my approach is correct because I can't find a function that would do the trick. Would I need to come up with another composition or is it enough to define a function that maps to the functions introduced above?
Update (in consideration of the answers given)
If I understand things correctly I can define: \begin{align}f_2: I_2 &\longrightarrow \mathbb{R} \\ x& \longmapsto \begin{cases}\phi(x) \ \text{for} \ x \in I_2 \\0 \ \text{for} \ x=\frac{\pi}{2} \end{cases} \end{align} Update 2 (Clarification required).
Define a new function to be equal to $\phi f_1$ over $I_1$ and have it map $π/2$ to $0$. As suggested (and upvoted) by @TBrendle.
If I do understand this correctly, then I need to map $x=\frac{\pi}{2}$ to $0$. However in this case it would make no sense to me to include $I_1$ in the domain, because $\pi/2$ is not in the domain, hence I don't see why I should include it in the codomain, however if I define: \begin{align}w: I_2 &\longrightarrow \mathbb{R} \\ (\phi\circ f_1)(x) & \longmapsto \begin{cases} (\phi \circ f_1) \ \text{if} \ x \in I_2 \\ 0 \ \text{if} \ x= \frac{\pi}{2} \end{cases} \end{align} This doesn't even look like a legitimate function to me anymore, since at $x=0$ the function evaluates to both $0$ and $1$.