Originally Posted by

**Bingk** I think there's a bit of a problem with your logic that if $\displaystyle p^2|a$ then all the powers in the prime factorization of $\displaystyle a$ will be even. If you think about it $\displaystyle p^2|p^3$, and $\displaystyle 3$ is not even ...

But if you use Taluivren's hint, you can take the prime decomposition of $\displaystyle ab$, and all the powers have to be even. Since $\displaystyle (a,b)=1$, we can rearrange the prime decomposition of $\displaystyle ab$ so it is written as the prime decomposition of $\displaystyle a$ multiplied by the prime decomposition of $\displaystyle b$. Then, we look at the respective prime decompositions and notice that the powers are all even. Again, by the hint, we have that $\displaystyle a$ and $\displaystyle b$ are also perfect squares.