Suppose $p$ is an odd prime number and that an integer $a$ has order $d\bmod p$, is it true that if $d$ is even, then $a^{\frac{d}{2}} \equiv -1\pmod p$.
I claim the answer is yes and show it with the following. Would appreciate if someone could verify my proof.
Let $d = 2k$ since $d$ is even for some $k \in \mathbb{Z}$. So we have $a^{2k} \equiv 1\pmod p \implies (a^{k})^2 \equiv 1\pmod p$. We know, since $p$ is a prime, that the solutions to $x^2 \equiv 1\pmod p$ are $x \equiv \pm 1\pmod p$.
If $a^{k} \equiv 1\pmod p$, contradicts order being $2k$. So we have $a^{k} \equiv a^{\frac{d}{2}}\equiv -1\pmod p$ as required.
If $p$ is an odd prime number, then by Fermat's little theorem, $a^{p-1} = 1 \mod p$. Therfore any integer $d$ such that $a^d = 1 \mod p$ must divide $p-1$. It follows by Fermat's Little Theorem that $a^{(p-1)/2} = ±1 \mod p$ as well. Again, if $a^d = 1 \mod p$, then $a^{d/2} = ±1 \mod p$. Suppose the order of $a \pmod p$, $d$ is even. Is $a^{d/2} = -1 \pmod p$? This depends on weather $a$ is a quadratic residue, or a quadratic non-residue modulo $p$. If $a$ is a quadratic residue modulo $p$, then $a^{d/2} = 1 \pmod p$, implying that the answer to your question is false. However, if $a$ is a quadratic non-residue, then $a^{d/2} = -1 \pmod p$. In fact, the Legendre Symbol, $(a | p)$ for some prime number $p$ is the same as $a^{(p-1)/2} \pmod p$.