If $\gcd(a,p)=1$, $p$ is prime, prove that there are $1\le x, y\le [\sqrt p]$ that $ax≡y\pmod p$ or $ax≡-y\pmod p$

42 Views Asked by At

If $\gcd(a,p)=1$, $p$ is prime, prove that there are $1\le x, y\le [\sqrt p]$ that $ax≡y\pmod p$ or $ax≡-y\pmod p$

I met this when looking proof of theory which says if $p=4k+1$ then there are $a,b$ that $a^2+b^2=p$. My question is how to prove that the above fact is always true for any $a$.