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!
$a$ is not a primitive root mod $p \iff a^n\equiv1\bmod p$ for $0<n<p-1$.
But if $a^n\equiv1\bmod p$ then since $a^{p-1}\equiv1\bmod p$, $a^d\equiv1\bmod p$ where $d=\gcd(n,p-1)$,
and since $\dfrac{p-1}2$ is prime, the only possibilities for $d$ would be $1, 2, $ and $\dfrac {p-1}2$,
which have been ruled out.