What you are trying to show is that is a group.

Multiplication is well defined and that is pretty easy to show. just show that

so it is closed under multiplication

You just gotta show it has an inverse. But this too is easy, if , then you know p and a are relatively prime. Otherwise p would not be prime as a and p would share a divisor.

but this means there exist integers x and y so that

but this tells you when you reduce mod p

so x reduced mod p is the inverse of a. Thus you have shown it to be a group