<s>[INST] If $ab$ is a square number and $\gcd(a,b) = 1$, then $a$ and $b$ are square numbers. 
Let $n, a$ and $b$ be positive integers such that $ab = n^2$. If $\gcd(a, b) = 1$, prove that there exist positive integers $c$ and $d$ such that $a = c^2$ and $b = d^2$

So far I have tried this:
Since $n^2 = ab$ we have that $n = \sqrt{ab}$.
Because $\gcd(a,b) = 1$, there exists integers $k$ and $l$ such that $ak + bl = 1$. This means that $\sqrt{a}(k\sqrt{}) + \sqrt{b}(l\sqrt{b}) = 1$.
Hence $\sqrt{a}$ and $\sqrt{b}$ are both positive integers and we can set $\sqrt{a} = c$ for some arbitrary integer $c$ and $\sqrt{b} = d$ for some arbitrary integer $d$. Therefore, $a = c^2$ and $b = d^2$.
 [/INST] Consider the prime factorization of $ab=n^2$. Each prime factor appears an even number of times because $n^2$ is a square (each prime factor of $n$ is repeated twice in the factorization of $n^2$).
The condition $\gcd(a,b)=1$ means that $a$ and $b$ have no common prime factors.
That means each prime factor of $a$ itself appears an even number of times; ditto for $b$. This in turn means that $a$ is a square and $b$ is a square.
</s>