Is this olympiad-like question about remainders an open problem? Suppose that we are given two positive integers $x$ and $y$ such that

$$x \mod p \leqslant y \mod p$$

for each prime number $p$. (Here, $x \mod p,\; y \mod p$ stand for the least non-negative residua.) Does it follow that $x = y$?

The problem is seemingly easy as we have to test $x,y$ against finitely many primes only. However, after several attempts I begin to wonder whether this is an open problem...

Note that it seems to be an open problem whether there is a prime number between a pair of squares (a reference would be appreciated), so the case where $x$ and $y$ are squares themselves is hard enough. However, it may well happen that this doesn't require such an argument.
This is a known theorem which is proved in this paper:  

a(mod p) ≤ b(mod p) for all Primes p Implies a = b  

Authors: P. Erdos, P. P. Palfy and M. Szegedy  

The American Mathematical Monthly, Vol. 94, No. 2 (Feb., 1987), pp. 169-170.  

Enjoy it!!!
Taking any prime number greater than $x$ and $y$ leads to $x\leq y$.

Now, every $p$ dividing $y$ also divides $x$ because then $x \mod p \leq 0$, thus $y=kx$.

For any prime number $p$ such as $x(k-1)&lt;p&lt;kx=y$ we obtain $y\mod p &lt;x$, with the condition that the primes dividing $k$ also divide $x$.

If we can prove there are always primes in such intervals then we have $x=y$.