Is there always a solution to the equation in the field $\mathbb{Z}_p$ ($p$ being a prime number)
$$ a^2 + b^2 \equiv c \pmod p $$
for a given $c \in \mathbb{Z}_p$? The solution need not be unique, I only want to know if there exist such $a, b \in \mathbb{Z}_p$ that satisfy the equation.
The usual proof that $a^2+b^2\equiv -1\pmod p$ has a solution works more generally.
Let $A=\{x^2\mid x\in\mathbb Z_p\}$ and $B=\{c-y^2\mid y\in\mathbb Z_p\}$. Then $A$ and $B$ both have $\frac{p+1}{2}$ distinct elements, so they must have an element in common.