Question: > 
> Let $n,m,k,l$ be positive integers and $p$ and odd prime with $0 \leq n,m,k,l \leq p-1$ and $$n+m \equiv k+l \pmod{p}, \quad n^2+m^2 \equiv k^2+l^2 \pmod{p}.$$ Prove that $\{m,n\} =\{k,l\}$.
> 
> 
> 

We can rearrange the third condition to get $(n-l)(n+l) \equiv (k-m)(k+m) \pmod{p}$. How do we continue from here?

Answer: 
This holds true in any field in which $2$ is invertible. Suppose 

$$a+b=c+d \tag{1} $$

$$a^2+b^2=c^2+d^2 \tag{2} $$

Square $(1)$, subtract $(2)$, then divide by $2$ to get

$$ ab=cd \tag{3} $$

This means we have an equality of polynomials

$$(x-a)(x-b)=(x-c)(x-d) \tag{4}$$

So both $\{a,b\}$ and $\{c,d\}$ are the roots of this polynomial.

There are two key ideas here:

* To know how to get from $(1)$ and $(2)$ to $(3)$, be familiar with the relationship between elementary symmetric polynomials and power symmetric polynomials (at least the first couple of each type).
* To know to combine $(1)$ and $(3)$ to $(4)$, know Vieta's formulas.

(A field is a number system with all the usual operations and properties - addition, multiplication, associativity, commutativity, distributivity, etc. - with the property that all nonzero elements have multiplicative inverses.)
For a more elementary solution: 

From the relations it follows that $2mn\equiv 2kl \pmod{p}$. Subtracting from the second gives $(m-n)^2\equiv(k-l)^2\pmod{p}$. Because $|m-n|<p$ and $|k-l|<p$ and $p$ is prime, it follows that either $m-n\equiv k-l\pmod{p}$ or $m-n\equiv l-k\pmod{p}$. Either way, adding to the first relation gives $m\equiv k\pmod{p}$ or $m\equiv l\pmod{p}$. This gives immediately what you want, considering that all $m,n,k,l$ are smaller than $p-1$, and $p$ is prime.