It seems that your real question is why the map $[(x,y)] \mapsto x/y$ is continuous. So let us consider
$$f : \mathbb C^2 \setminus \{ (0,0) \} \to \hat{\mathbb C}, f(x,y) = x/y .$$
Here we understand $x/0 = \infty$ (note that the expression $0/0$ cannot occur because $(0,0)$ is not in the domain of $f$). This map is surjective since $f(z,1) = z$ and $f(1,0) = \infty$.
Obviously $f$ is continuous in all points $(\zeta,\omega)$ with $\omega \ne 0$. Now consider $(\zeta,0)$ with $\zeta \ne 0$. Let $((z_n,w_n))$ be a sequence in $\mathbb C^2 \setminus \{ (0,0) \}$ converging to $(\zeta,0)$. This means $z_n \to \zeta$ and $w_n \to 0$. Since $\zeta \ne 0$, we have $\lvert z_n \rvert > \lvert \zeta \rvert/2$ for $n \ge n_0$. Moreover, given $R > 0$, we have $\lvert w_n \rvert < 2/R\lvert \zeta \rvert$ for $n \ge n_R$. Thus for $n \ge \max(n_0,n_r)$
$$\lvert f(z_n,w_n) \rvert = \begin{cases} \infty > R & w_n = 0 \\ \lvert z_n/w_n \rvert= \lvert z_n \rvert/ \lvert w_n\rvert > \lvert \zeta \rvert/2\lvert w_n\rvert > R & w_n \ne 0 \end{cases}$$
This shows that $f(z_n,w_n) \to \infty = f(\zeta,0)$. Therefore $f$ is continuous in $(\zeta,0)$.
It is easy to verify that $f(z,w) = f(z',w')$ if and only if $(z,w) \sim (z',w')$. Hence $f$ induces a continuous bijection
$$F : \mathbb{CP}^1 \to \hat{\mathbb C}. $$
Since $ \mathbb{CP}^1$ is compact and $\hat{\mathbb C}$ is Hausdorff, $F$ is a homeomorphism.
Remark:
The same proof shows that $[(x,y)] \mapsto x/y$ is a homeomorphism $\mathbb{KP}^1 \to \hat{\mathbb K}$ for $\mathbb K = \mathbb R, \mathbb C, \mathbb H$ = field of quaternions. We have $\hat{\mathbb R} \approx S^1,\hat{\mathbb C} \approx S^2, \hat{\mathbb H} \approx S^4$.
S/\sim, then that space shouldn't be there, and yet it is. The solution is to write $S/{\sim},$ coded asS/{\sim}. I edited accordingly. To some, seeing $S/\sim$ instead of $S/{\sim},$ seems akin to a spelling error. There are others who actually don't notice things like that unless they're pointed out, but this still affects their overall aesthetic reaction to the typography. $\qquad$ – Michael Hardy Aug 08 '20 at 19:27