I am not sure how to tackle this problem and yes it is a homework problem. Here is what I have. I know that $\text{ord}(a) = h$ and h is even so $h = 2 \alpha$ for some $\alpha \in \mathbb{Z}$. I also know Euler's criterion which states that $$a^{\frac{p-1}{2}} = -1 \pmod{p}$$ if there are no integers $x$ which satisfy $x^2 = a \pmod{p}$. So my steps are
$a^h = (x^2)^h = 1 \pmod{p}$ which implies $p | x^{2h} - 1$. I am now stuck, am I in the right direction? Please let me know a hint.
Thanks