Hint: A number is a perfect square iff all exponents in its prime decomposition are even.
Use this on ab. Since (a,b)=1, it is clear how prime decompositions of a and of b must look like.
Q: Show that if a, b are positive integers such at (a,b)=1 and ab is a square, then a and b are also squares.
Pf: (by Contradiction)
Suppose a and b are not squares, then a=h*k and b=p*q where h,k,p,q are all unique primes. (Is this the right approach to this proof?)
This is wrong, please see post below from BingK
The proof is valid for any p. So in your specific question -
case 1: h is prime - then be same logic you can show . But as that is not the case hence h can't be prime.
so h is composite - then also if q is a prime such that then you can show that . Infact h itself is a perfect sqaure - as it should be
The idea of the proof is that for "any" prime , , which divides , also divides a. So in the prime- factorization of a all the powers will be even.
Logic for a can be replicated for b. Thus the statement will be true for ab as well. If all powers of prime are even then the number is a perfect square. Using this fact we conclude ab is a perfect square.
Hope it helps.
I think there's a bit of a problem with your logic that if then all the powers in the prime factorization of will be even. If you think about it , and is not even ...
But if you use Taluivren's hint, you can take the prime decomposition of , and all the powers have to be even. Since , we can rearrange the prime decomposition of so it is written as the prime decomposition of multiplied by the prime decomposition of . Then, we look at the respective prime decompositions and notice that the powers are all even. Again, by the hint, we have that and are also perfect squares.