It really all depends on what you know at this point, there are a ton of proofs of this. I think the most elementary way is by noticing that is a field. In particular the nonzero elements form a group under multiplication. Inverses are unique, so when you look at

you are just left with the product of things that are their own inverse. That is the things such that , this is clearly 1 and (mod p).

Thus (mod p).

The converse is trivial because if when n is composite, say n=jk. Then (p-1)!=0 because j and k are zero divisors.