<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] Let $a = \Pi_{i=1}^{r} p_i^{d_i}$ and $b=\Pi_{j=r+1}^{r+s} p_j^{d_j}$ be the unique prime factorizations of $a$ and $b$, respectively.  Since $gcd(a,b)=1$, none of the $r$ primes which are divisors of $a$ is equal to any of the $s$ primes which are divisors of $b$.  Hence, the product $ab$ can be written as $ab=\Pi_{i=1}^{r+s} p_i^{d_i}$, where the $p_i$'s are distinct. 
Since $ab$ is a perfect square, each $d_i$ is even.  Suppose $d_i = 2e_i$ for $i=1,\ldots, r+s$.  Then, $a=x^2$ and $b=y^2$, where $x = \Pi_{i=1}^r p_i^{e_i}$ and $y=\Pi_{j=r+1}^{r+s} p_j^{e_j}$.
</s>