This problem is from Herstein's Topics in Algebra.
I have to use the property that if a finite set is closed under an associative product and that both cancellation laws hold in $G$, then $G$ is a group to prove the following:
Non-zero integers modulo $p$, a prime number, form a group under multiplication $\mod p$
Non zero integers relatively prime to $n$, form a group under multiplication $\mod n$.
I am very new to modular arithmetic and group theory, and stuck badly. I am trying to do the above, by assuming some numbers $a= pq + r$, where $q$ is an integer, so $a=r (mod\, p)$ but I don't know how to incorporate the facts prime and relatively prime, to solve the problem.