Q:

Surjectivity of a function $f:\mathbb{D}^n\to \mathbb{S}^n$.

I'm trying to prove that $\mathbb{D}^n/\sim$ is homeomorphic to $\mathbb{S}^n$, where $\sim$ is an equivalence relation given by, $$x\sim y\quad\text{ if and only if }\quad x=y\quad\text{ or }\quad x,y\in \mathbb{S}^{n-1}.$$ So, I defined the function,
\begin{align}
f:\mathbb{D}^n&\longrightarrow \mathbb{S}^n\\
x=(x_1,\dots,x_n)&\longmapsto 
\begin{cases}
\left(\dfrac{x_1\sin(\pi \lVert x\rVert)}{\lVert x\rVert},\dots,\dfrac{x_n\sin(\pi \lVert x\rVert)}{\lVert x\rVert},\cos(\pi\lVert x\rVert)\right),&\text{ if }x\neq 0\\
(0,0,\dots,1),\textrm{ if }x=0.
\end{cases}
\end{align}
I've already proved that $f$ is a continuous closed map. The only thing missing is the surjectivity of $f$. Any suggestion?
Thanks.

A:

It is more elegant to regard $S^n$ as a subset of $\mathbb R^n \times \mathbb R$ and to write
$$f(x) = \begin{cases}
\left(\sin(\pi \lVert x\rVert)\dfrac{x}{\lVert x\rVert},\cos(\pi\lVert x\rVert)\right)& x\neq 0\\
(0,1) & x=0.
\end{cases}$$
Now let $(y,t) \in S^n$, i.e. $\lVert y \rVert^2 + t^2 = 1$. This implies

$\lVert y \rVert^2 \le 1$, i.e. $y \in D^n$.

$t^2 \le 1$, i.e. $t \in[-1,1]$ and there exists a unique $s_t \in [0,1]$ such that $\cos (\pi s_t) = t$.

Case 1. $t = 1$. Then $\lVert y \rVert^2 = 0$, i.e. $y = 0$. Thus $f(0) = (0,1) = (y,t)$.
Case 2. $t = -1$. Then $\lVert y \rVert^2 = 0$, i.e. $y = 0$. For any $x \in S^{n-1} \subset D^n$ we have $\lVert x \rVert = 1$ and thus $f(x) = \left(\sin(\pi 1)\dfrac{x}{1},\cos(\pi 1)\right) = (0,-1) = (y,t)$.
Case 3. $-1 < t < 1$. Then $t^2 < 1$ and hence $\lVert y \rVert^2 >  0$, i.e. $y \ne 0$. Let $x = s_t\dfrac{y}{\lVert y \rVert}$. Then $\lVert x \rVert =s_t$. Note that $0 < s_t < 1$ in case 3. We claim that $\sin(\pi \lVert x\rVert)\dfrac{x}{\lVert x\rVert} = y$ which shows that $f(x) = (y,t)$. We have $\sin(\pi \lVert x\rVert)\dfrac{x}{\lVert x\rVert} = \sin(\pi s_t)\dfrac{y}{\lVert y\rVert}$, thus it suffices to show that $\dfrac{\sin(\pi s_t)}{\lVert y\rVert} = 1$. Since $0 < s_t < 1$, we have $\sin(\pi s_t) > 0$, thus it suffices to show $\sin^2(\pi s_t) = \lVert y\rVert^2$. But this is clear since $\lVert y\rVert^2 = 1 - t^2 = 1- \cos^2(\pi s_t) = \sin^2(\pi s_t)$.

