Here is what I got so far:
Let $\gcd(ka,km) = d$
Then by the Euclidean Algorithm, we have integers $s,t$ such that:
$$s(ka) + t(km) = d \implies k|d $$
Let $$d/k = g = sa + tm. \tag{1}$$
So now I need to show that $g$ is indeed = $\gcd(a,m)$. Let $\gcd(a,m) = h$
Now since $k|d \implies d|a , d|m \space $ (since $$\gcd(ka,km) = d \implies g| \gcd(a,m) = h \\\implies h = dj ,$$ for some integer $j$.
Putting this into (1):
$$ h/jk = g = sa + tm $$
since $$h = dj \implies dj/j = kg \\ \implies d = kg. $$
So $g$ is the $\gcd(a,m)$?
Is this a correct proof? Or have I gone in some sort of circle? Many thanks for any hints or direction!