This system has solutions iff $GCD(m,n)|a-b$ I'm trying to solve this question below:

I thought this question would be trivial, but I don't know how to solve any of the implications. any help would be very appreciate.

This is asking about a simultaneous solution of two congruences, and
is related to the Chinese Remainder Theorem. The general solution of the
first congruence is $X=mY+a$ where $Y\in\Bbb Z$. Putting this in the
other gives $mY+a\equiv b\pmod n$, equivalently
$$mY\equiv b-a\pmod n.\tag1$$
So, what is the criterion for the congruence $(1)$ to be soluble?
