Let $p > 2$ be a prime number with the property that $ q:= \frac{p-1}{2} $ is also prime.
Let $a$ $ \in \mathbb{Z} $ with $$a \not\equiv 0,-1( \text{ mod }p )$$
How can I show that if
$$ a^{\frac{p-1}{2}} \not\equiv 1 ( \text{ mod } p ),$$ then $a $ is a primitive root modulo p ?
I don't get the right Idea to prove it..maybe you can help!
Thank you very much in advance!