I have to prove that if $p$ is a prime number of the form $p = 4n - 1$, $n\in N$ and $x^2+y^2\equiv 0\pmod{p}$, then $x\equiv 0\pmod{p}$ and $y\equiv 0\pmod{p}$.
I have gone about this as follows and I hope you will correct me if I made any errors:
First of $x^2 + y^2$ is divisible by p so we can write it as being equal to some multiple $k$ of $p$ $+$ a remainder of $0$.
Then let's assume the opposite that neither $x$ or $y$ are congruent to $p$ ergo they aren't divisible by $p$ so we can represent them as being equal to some multiples $l$ and $m$ of $p$ (respectively) and with remainders (nonzero of course) $a$ and $b$ (respectively).
So we get:
$$ x^2 + y^2 = kp + 0$$ $$ x = lp + a $$ $$ y = mp + b$$
If we take the second and third expression and square them we get: $$ x^2 = l^2p^2 + 2lpa + a^2 $$ $$ y^2 = m^2p^2 + 2mpb + b^2$$
Then we add them up:
$$ x^2 + y^2 = l^2p^2 + 2lpa + a^2 + m^2p^2 + 2mpb + b^2$$
Factorize:
$$ x^2 + y^2 = \left(l^2p + 2la + m^2p + 2mb\right)p + a^2 + b^2$$ We see that $k = l^2p + 2la + m^2p + 2mb$, which gives us:
$$ x^2 + y^2 = kp + a^2 + b^2$$
At the beginning it is stated that the remainder $a$ is equal to zero since $x^2 + y^2$ is divisible by $p$ so get to the conclusion that the sum of two nonzero, positive numbers, more precisely the sum of two squares $a^2 + b^2$ has to be $0$. This is a contradiction.
The contradiction was brought on by the assumption that $x$ and $y$ aren't divisible by $p$ therefore we conclude that $x$ and $y$ must be divisible by $p$.