Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 3.1 Exercise 3.1.6
Define $\varphi : \mathbb{R}^\times \rightarrow \{ \pm 1 \}$ by $x \mapsto x / |x|$. Describe the fibers of $\varphi$ and prove that $\varphi$ is a homomorphism.
Solution: First, note that $\{ \pm 1 \}$ is a subgroup of $\mathbb{R}^\times$ and is isomorphic to $Z_2$, and that $x / |x|$ is either $1$ or $-1$, so that $\varphi$ is properly defined.
Now $\varphi$ is a homomorphism since $$\varphi(xy) = xy/|xy| = x/|x| \cdot y/|y| = \varphi(x) \varphi(y).$$ Finally, it is clear that $\varphi(x) = 1$ if and only if $x > 0$, and that $\varphi(x) = -1$ if and only if $x < 0$.