Have you tried plugging in some numbers? Sometimes the obscure becomes obvious when you have some specific numbers to deal with. Let's say $a = 70$, $b = 47$, $m = 21$.
Then $d = \gcd(70, 21) = 7$ and $$d' = \gcd\left(21, \frac{21}{7}\right) = \gcd(21, 3) = 3.$$
It now seems obvious to me that $d$ is a divisor of $m$ (since it's the greatest common divisor of $a$ and $m$), and therefore $\frac{m}{d}$ is also a divisor of $m$. If $\frac{m}{d} < m$, then $\frac{m}{d}$ is the greatest common divisor of $m$ and itself. And if $\frac{m}{d} = m$ (which is the case if $d = 1$) then the number is trivially its greatest common divisor with itself (unless that number is 0, but that's a whole other can of worms).
Either way, $$d' = \frac{m}{d},$$ as you were asked to show.