-g is a prim. root of p iff $-1=(-g)^\frac{p-1}{2}=(-1)^\frac{p-1}{2}g^\frac{p-1}{2}=(-1)^\frac{p-1}{2}(-1)\Longleftrightarrow (-1)^\frac{p-1}{2}=1$ $\Longleftrightarrow \frac{p-1}{2}=2k\,,\,\,k\in\mathbb{Z}$ $\Longleftrightarrow$ ...