Prove the following results for the odd prime $p$:
(a) If $a$ is a quadratic residue then $p-a$ is a quadratic residue if and only if $p \equiv 1 \pmod 4$.
(b) If $a$ is a quadratic residue then $p-a$ is a quadratic non-residue if and only if $p \equiv 3 \pmod 4$.
Since $a$ is a quadratic residue, then $p \not \mid a$. That is, there is no integer $k$ such that $pk = a$.
If we consider $pj = p-a$ for some integer $j$, we have $p(1-j) = a$. This is not possible since there is no integer $k=(1-j)$ such that $pk=a$. And so $p \not \mid p-a$.
This means we can use Euler's Criterion (7.5) which tells us that $p-a$ is a quadratic residue of $p$ if and only if
$$ (p-a)^{\frac{p-1}{2}} \equiv (-a)^{\frac{p-1}{2}} \equiv 1 \pmod p $$
We write odd prime $p$ as $p=4x +t$, where $x$ is an integer and $t$ is one of 1 or 3 only. Why? Because $t=0$ or $t=2$ would mean $p$ is even and not an odd prime.
If $t=1$, that is $p \equiv 1 \pmod 4$, then $p-a$ is a quadratic residue of $p$ if and only if
$$ (-a)^{2x} \equiv 1 \pmod p $$
Since $a$ is a quadratic residue, Euler's Criterion tells us that $a^{2x} \equiv 1 \pmod p$. Multiplying by $(-1)^{2x} = 1$ gives the desired $(-a)^{2x} \equiv 1 \pmod p$.
If $t=3$, that is $p \equiv 3 \pmod p$, then $p-a$ is a quadratic residue of $p$ if and only if
$$ (-a)^{2x+1} \equiv 1 \pmod p $$
Since $a$ is a quadratic residue, Euler's Criterion tells us that $a^{2x+1} \equiv 1 \pmod p$. Multiplying by $(-1)^{2x+1} = -1$ gives $(-a)^{2x+1} \equiv -1 \pmod p $. This means the requirement for $p-a$ to be a quadratic residue is not met.
We have concluded that if $a$ is a quadratic residue of odd prime $p$, then
(a) $p-a$ is a quadratic residue if and only if $p \equiv 1 \pmod 4$.
(b) $p-a$ is a quadratic non-residue if and only if $p \equiv 3 \pmod 4$.