Let $Z=D^2=\{re^{i\theta} : r \leq 1\}$, $W=S^2$, $B=S=\{re^{i\theta} : r = 1\}$. Define the map $f$: $$f: Z \rightarrow W, f(re^{i\theta})= \big(\sin{(\pi r)} \cos{(\theta)}, \ \sin{(\pi r)} \sin{(\theta)}, \ \cos {(\pi r)}\big).$$
I want to prove that $f(z) = f(w)$ implies $z \thicksim w$, where $$z \thicksim w \iff z, w \in B \ \text{or} \ z=w$$
I have proceeded directly, letting $z = re^{i\theta}, w=se^{i\alpha}$ and setting $f(z) = f(w)$. But when I equate the coordinates and solve the resulting equations the most I get is $$ s \equiv r \ \pmod 2, \ \theta = \alpha + n\pi$$ $$\implies s=r, \ \theta = \alpha + n\pi, $$ for $n \in \mathbb Z$. Obviously this isn't what I want as I would want $s=r=1$, so I'm wondering if I've went wrong somewhere or this is just not possible.
CONTEXT: I am trying to prove that $Z/B \cong W$, i.e. $D^2/S^1 \cong S^2$. I have proved that $f$ is a quotient map so it suffices to just prove this property.
If I understand your setup, you want to define $z\sim w$ to be $z,w\in B$ or $z=w$ (so $\sim$ identifies all points in $B$ and is equality everywhere else).
Now, when doing your computations from the assumption $f(z)=f(w)$, you get $r=s$ by considering the third coordinate of $f$ (and since $0\leq r,s\leq 1$). If $r=1$ then $z,w\in B$ and $z\sim w$. On the other hand, if $0<r<1$ then $\sin(\pi r)\neq 0$ so you can divide in the first two coordinates to get $\sin(\theta)=\sin(\alpha)$ and $\cos(\theta)=\cos(\alpha)$. Since $0\leq \theta,\alpha<2\pi$, you get $\theta=\alpha$. So you get $z=w$ and $z\sim w$.