Prove that $b^2-4ac \equiv 0 \pmod{p}$ 
Let $a,b,c,r$ be integers and $p \geq 5$ be a prime such that $ax^2+bx+c \equiv a(x-r)^2 \pmod{p}$. Prove that $b^2-4ac \equiv 0 \pmod{p}$. Does the same hold if $p = 3$? 

I wasn't sure how to go about proving this. We can rearrange the congruence to get $$x(b+2ar)+c-ar^2 \equiv 0 \pmod{p}.$$ How do we continue from here?
 A: Here we need to assume we have a polynomial identity mod $p$, not just an incidental equality:
$$ x(b+2ar)+c-ar^2 \equiv 0 \pmod{p} $$
Letting $x = 0$ gives $c - ar^2 \equiv 0 \pmod{p} $, so in fact $c \equiv ar^2 \pmod{p} $.
Now let $x = b - 2ar$, and use the given relation $c \equiv ar^2 \pmod{p} $:
$$ (b - 2ar)(b + 2ar) \equiv 0 \pmod{p} $$
$$ b^2 - 4a^2r^2 \equiv 0 \pmod{p} $$
Finally backsubstituting $c \equiv ar^2 \pmod{p} $ gives the desired result:
$$ b^2 - 4ac \equiv 0 \pmod{p} $$
In this direction no restriction on $p$ is necessary to get the implication.
A: Since $ax^2+bx+c \equiv a(x-r)^2 \pmod{p}$ is a "forall" statement for all the x in least residue system  with respect to p,
$x(b+2ar)+c-ar^2 \equiv 0 \pmod{p}$  also satisfies this condition. 
Since $0$ and $1$ are in the  least residue system  with respect to p, Therefore
$$0 \times (b+2ar)+c-ar^2 \equiv c-ar^2 \equiv 0 \pmod{p} \tag{1}$$
$$1 \times (b+2ar)+c-ar^2 \equiv (b+2ar) \equiv 0 \pmod{p} \tag{2}$$
Then from $(1)$ and $(2)$, $b^2 - 4ac \equiv (-2ar)^2 - 4a(ar^2) \equiv 4a^2r^2- 4a^2r^2 \equiv 0 \pmod{p}$
