<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] This:

$\sqrt{a}$ and $\sqrt{b}$ are both positive integers

does not follow from

$\sqrt{a}(k\sqrt{a}) + \sqrt{b}(l\sqrt{b}) = 1$.

For instance,
$$ \sqrt{2}((-1)\sqrt{2}) + \sqrt{3}((1)\sqrt{3}) = 1$$
($a = 2, b = 3, k = -1, l = 1$).
What you need to do instead is use prime factorization.
</s>