Solution (source code)

= Solution
{c}

Write $s=(a/p)$. If $p\mid a$, both sides of the proposed identity are zero. Otherwise $s=\pm1$. The <multiplicativity of the Legendre symbol> and <Euler's criterion> give
$$
\left(\frac{sa}p\right)=\left(\frac sp\right)\left(\frac ap\right)
=s^{(p-1)/2}s=\boxed{s^{(p+1)/2}.}
$$
For the middle equality, Euler's congruence determines the sign exactly, since both the symbol and $s^{(p-1)/2}$ are in $\{1,-1\}$ and $p$ is odd.