<s>[INST] Let $m,n\in \mathbb{Z}$ and $p(x)=x^3+mx+n$ be such that if $107\mid p(x)-p(y)\implies 107\mid x-y$. Prove that $107\mid m$. 
Let $m,n\in \mathbb{Z}$ and $p(x)=x^3+mx+n$ be such that for an integers $x,y$ we have: $$107\mid p(x)-p(y)\implies 107\mid x-y$$ Prove that $107\mid m$.


I'm not sure what to do here. I can only deduce that $$107\nmid x^2+xy+y^2+m$$
and since $x\equiv y \pmod {107}$ $$ 107\nmid 3x^2+m$$ Suppose $107\nmid m$ then expressing this with Legendre symbol we have $$\Big({-3m\over 107}\Big)=-1$$
Any sugestion?
 [/INST] $p(x)-p(y)=x^3-y^3+m(x-y)=(x-y)(x^2 + xy + y^2+m)$
The condition is $$x^2+xy+y^2 +m \not \equiv 0 \pmod{107}, \quad when \quad x\not\equiv y \pmod{107}$$
Setting $y=0$ we get $$ x^2 + m \not \equiv 0 \quad when \quad x\not\equiv 0$$
Since $-1$ is quadratic nonresidue modulo 107 (because $(-1)^{53}\equiv -1$), we have that $$m \text{ is quadratic residue modulo 107}$$
Let $m\equiv a^2 \not \equiv 0 \pmod{107}$

Note Below I will write $\frac{1}{y}$ to mean some integer number such that $y\cdot \frac{1}{y}\equiv 1 \pmod{107}$. Such a number exists iff $y\not\equiv 0$. And $\frac{x}{y}$ means $x\cdot \frac{1}{y}$.

Rewrite the condition in the form
$$ x^2 + xy+ y^2 \not\equiv-a^2 $$
$$\forall b\not\equiv 0 \quad (\frac{x}{y})^2 + \frac{x}{y} +1 \not\equiv -b^2$$
$$\forall b\not\equiv 0 \quad \lambda ^2 + \lambda + 1 \not \equiv -b^2$$
Plugging in $\lambda=2$ yields $7$, which is a quadratic non residue modulo 107. 
That means that $2^2 + 2 +1 \equiv -b^2$ for some $b$, multiply that by $\frac{a^2}{b^2}$ to get $\frac{\lambda^2 a^2}{b^2} + \lambda \frac{a^2}{b^2} + \frac{a^2}{b^2} \equiv -a^2$ that is $$ (\frac{\lambda a}{b})^2 + \frac{\lambda a}{b} \frac{a}{b} + (\frac{a}{b})^2 \equiv -a^2$$
since $\lambda = 2 \not \equiv 1$, we have a pair $x=\frac{2 a}{b}$ and $y=\frac{a}{b}$ contradicting the condition.
</s>