The question states the following:
Prove that the system $x \equiv a \bmod m, x \equiv b \bmod n$ has solution iff $\gcd(m,n) \vert a-b.$
The first implication is immediate since $x-a = km,x-b=qn$, hence subtracting both expressions we get that $a-b = qn - km$, $a-b \in (m,n)$, $\gcd(m,n) \mid (a-b)$. However, I don't know how to prove the reciprocal. Any suggestions?