Prove that every positive integer $n$ is a unique product of a square and a squarefree number I am trying to prove that for every integer $n \ge 1$, there exists uniquely determined $a > 0$ and $b > 0$ such that $n = a^2 b$, where $b$ is squarefree.
I am trying to prove this using the properties of divisibility and GCD only. Is it possible?
Let me assume that $n = a^2 b = a'^2b'$ where $a \ne a'$ and $b \ne b$'. Can we show a contradiction now?

For existence: given $n\geq1$, there is a maximal-for-divisibility integer $a$ such that $a^2$ divides $n$ and then $n=a^2b$ for some $b$. If $b$ is divisible by the square of a positive integer $c$, then $n$ is divisible by $(ac)^2$, then the maximality of $a$ implies that $ac=a$, that is that $c=1$: this means that $b$ is squarefree.
For uniqueness: suppose now that we also have $n=c^2d$ with $d$ squarefree. The maximality of $a$ implies that $c\mid a$, so there is an $e$ such that $a=ce$, and then from $c^2e^2b=a^2b=c^2d$ we get $e^2b=d$: since $d$ was supposed to be square free, $e=1$. It follows that $a=c$ and $b=d$.
It should be noted that proving there exists a maximal-for-divisibility $a$ such that $a^2\mid n$ depends on the basic properties of the divisibility relation and the GDC. All the rest is more or less tech-free.
