Hi, I have this question and i'm really struggling.

Show that for any prime p either is prime or behaves like a prime with respect to the base 2 ie (mod q)

I know this is to do with Fermat's little theorem. But i dont know where to start. Please can someone give me a clue?

Thanks,

Katy