TITLE: Finding a homomorphism from a subset of the fractions to the ring $\mathbb{Z}_p$.
QUESTION [5 upvotes]: I'm practicing using the First Isomorphism Theorem for rings. Here is a question I got stuck on.

Let $p$ be prime and let $T$ be the set of rational numbers (in lowest terms) whose denominators are not divisible by $p$. Let $I$ be the set of elements in $T$ whose numerators are divisible by $p$. Show that $T/I\cong \mathbb{Z}_p$. 

Basically I need a surjective homomorphism from $T$ to $\mathbb{Z}_p$ with kernel $I$. My thought was to define $f:T\to \mathbb{Z}_p$ by $f(m/n)=[m]_p$ but this turns out not to be a homomorphism. For example choosing $p=5$, now $f(\frac{3}{2}+\frac{1}{3})=f(\frac{11}{6})=[11]_5=[1]_5 \neq [4]_5=[3]_5+[1]_5=f(\frac{3}{2})+f(\frac{1}{3})$. 
I've also tried $f(m/n)=[mn]_p$, $f(m/n)=[n]_p$, and $f(m/n)=[m+n]_p$ but nothing seems to work. 
I would appreciate some hints as to what kind of a function I need to choose. Thanks!

REPLY [2 votes]: Hint: any $x \in T$ can be written as $m/n$ where $m, n \in \Bbb{Z}$, $0 < n$ and $p$ does not divide $n$. As $p$ does not divide $n$, the image $[n]$ of $n$ in the ring $\Bbb{Z}_p$ is non-zero. Because $p$ is prime, $\Bbb{Z}_p$ is a field, so $[n$] has a multiplicative inverse, $[n]^{-1}$. Now show that $x \mapsto [m]\cdot[n]^{-1}$ is a well-defined ring homomorphism of $T$ onto $\Bbb{Z}_p$ with kernel $I$.