Let a,b be positive integers. Prove there exist positive integers $c$, $d$ such that $cd = a$ and $\gcd(c,d) = b$ if and only if $b^2\mid a$.
Proof exists $cd=a$ and $\gcd(c,d) = b \Rightarrow b^2\mid a$:
Let c = bm, d = bn. Then $cd = b^2mn = a$ and so $b^2\mid a$.
Not quite sure how to prove $b^2\mid a$ -> exists $cd=a$ and $\gcd(c,d) = b$. I thought maybe proof by contraposition. Thanks.