# Prove gcd and common divisor

I have this math problem.

Let $a, b, m$ be any positive integers with $\gcd(a,m)=d$ and $\gcd(b,m)=1$.

i) Show that if $k$ is a common divisor to $ab$ and $m$, then $k$ divides $d$.

ii) Use the result in part i) to conclude that $\gcd(ab, m)=d$.

I'm not 100% sure about how to start this. Can I conclude that if $k\mid ab$, then $k\mid a$? If I can do that, then I can say since $k\mid a$ and $k\mid m$, $k\mid d$.

Thanks

Let $k$ be a common divisor to $ab$ and $m$. Since $k|m$ and $(b,m) = 1$, $(b,k) = 1$. Thus $k|ab$ and $(b,k) = 1$ implies $k |a$, and thus also $k|d$.
For part (ii), $k|d$ implies $k \leq d$. Since $k|m$ and $k|ab$, $gcd(ab,m) \leq d$. But since $d |ab$ and $d|m$, we know $gcd(ab,m) \geq d$. Thus $gcd(ab, m) = d$.