Here's what I have:
$ax \equiv b (mod\ m)$ has answer if there are $x$ and $y$ such that
$b = ax + my$
Let $d = gcd(a,m)$. Then:
$d|a$ and $d|m \Leftrightarrow d|ax$ and $d|my \Leftrightarrow d|(ax+my)$
Since $m$ divides the right part of the equation, it also has to divide the left part.
Is this a valid proof for what I want?
If $\;d=gcd(a,m)\;$, then there exist $\;r,s\in\Bbb Z\;$ s.t. $\;ra+sm=d\;$ , so
$$b=cd\implies b=c(ra+sm)=a(cr)+m(cs)$$
and we have a solution.