If $a$ is integer and $n$ is positive integer such that $\gcd(a,n)=1$ then there exist integers $x,y$ for which $0<|x|,|y|<\sqrt{n}$ and $ax\equiv y\pmod n$.
By Dirichlet's principle I could found that $|x|,|y|\le \sqrt n $ but how to rule out $|x|=\sqrt n $ or $|y|=\sqrt n$?
You can use the pigeonhole principle. There are $2\lceil \sqrt n \rceil-2$ choices for each of $x,y$, so $(2\lceil \sqrt n \rceil-2)^2 \gt n$ ways to try to match them up. At least one will match.