Prove that if there are integers $x$ and $y$ such that $ax + by= n$ then $g \mid n$ where $g= gcd (a, b)$.
If $g=\gcd(a,b)$ then we have $g \mid a$ and $g \mid b$. That is, for some integers $c,d$
$$\begin{align} a &= cg \\ \\ b &= dg \end{align}$$
Substituting for $a$ and $b$ in $ax + by = n$ gives us
$$\begin{align} (cg)x + (dg)y & = n \\ \\ g(cx + dy) & = n \end{align}$$
This tells us $g \mid n$.