If $a^2$ divides $b^2$, then $a$ divides $b$ 
Let $a$ and $b$ be positive integers. Prove that: If $a^2$ divides $b^2$, then $a$ divides $b$.

Context: the lecturer wrote this up in my notes without proving it, but I can't seem to figure out why it's true. Would appreciate a solution. 
 A: The proofs given use the Unique Factorization Theorem, or the existence of GCDs, or some equivalent, but the result is true even in places where there aren't any GCDs, so there must be a proof that doesn't rely on these properties. Here's one that works in the ring $O_K$ of integers in a number field $K$, whether there are GCDs or not. 
If $a,b$ are in $O_K$ and $a^2$ divides $b^2$, then $b^2=a^2c$ for some $c$ in $O_K$. So $\sqrt c=b/a$ is in $K$. But $\sqrt c$ is a zero of $x^2-c$, a monic polynomial with algebraic integer coefficients, so $\sqrt c$ is an algebraic integer, so $\sqrt c$ is in $O_K$, so $a$ divides $b$. 
A: An argument that uses only the definition of divisibility and the well-ordering principle. (Why bother? Because minimalism is interesting.)
Let $k$ be the smallest positive integer for which $a \mid bk$.  Suppose $l$ is the integer for which $bk = al$ and $m$ is the integer for which $b^2 = a^2 m$.  Then $a b l = b^2 k = a^2 k m$, so that $b l = a k m$.
Use the division algorithm (an easy consequence of well-ordering) and write $l = kq + r$ with $0 \leq r < k$.  Then $br = a k m - b k q = a (k m - l q)$. Thus, $a \mid br$.  From our assumption that $k$ is the smallest positive integer for which $a \mid bk$, we find that $r=0$.
Thus, $l = kq$, so $bk = al = akq$, so $b = aq$ and $a$ divides $b$.
(This implies also that if $a^{2^k} \mid b^{2^k}$, then $a \mid b$. I don't see immediately an extension that works to prove that if $a^n \mid b^n$, then $a \mid b$, but am happy to edit if someone else does.)
A: By the fundamental theorem of arithemtic, you can write $a$ and $b$ as a product of primes, say
$$
a=p_1^{\alpha_1}\cdots p_r^{\alpha_r},\qquad b=p_1^{\beta_1}\cdots p_r^{\beta_r}
$$
where $\alpha_i,\beta_i\geq 0$. Allow the exponents to possibly be $0$ if such a prime $p_i$ occurs in the factorization of one integer but not the other.
So $a^2=p_1^{2\alpha_1}\cdots p_r^{2\alpha_r}$ and $b^2=p_1^{2\beta_1}\cdots p_r^{2\beta_r}$. Since $a^2\mid b^2$, by unique factorization, necessarily $2\alpha_i\leq 2\beta_i$ for each $i$. That implies $\alpha_i\leq\beta_i$ for all $i$, and so $a\mid b$.
A: Here's an alternative proof only relying on a more general definition of greatest common divisors (in commutative monoids or commutative rings). In particular, we say that $gcd(a,b)=d$ if:


*

*$d$ is a common divisor of $a$ and $b$ (ie $d\vert a$ and $d \vert b$), and

*Given any other common divisor $d'$ of $a$ and $b$, we have $d'\vert d$


Throughout this proof, we'll assume that we're in a commutative monoid for which every pair of elements has a greatest common divisor (or, if you'd prefer, you can imagine just sticking to $\mathbb{N}$ under multiplication).
So, suppose that $a^2 \vert b^2$, and let $gcd(a,b)=d$. Then, we have $d\alpha =a$ and $d\beta = b$ for some $\alpha,\beta$. It then follows that $gcd(\alpha,\beta)=1$ (if you're unsure as to why, it would be worth the time to write down a proof using the definition of GCD given above).  
Now, since $a^2 \vert b^2$, there exists $k$ such that $a^2 k = b^2$, and hence $\alpha^2 k = \beta^2$. Therefore we have $\alpha \vert \beta^2$ implying that $\alpha \vert \beta$ (if you're not sure as to why, again, it would be worth writing down a proof).  However, $gcd(\alpha,\beta)=1$ and $\alpha \vert \beta$ implies that $\alpha=1$ (or, more generally, $\alpha$ is an invertible element in our monoid), hence $gcd(a,b)=a$ and $a \vert b$.
In fact, this same line of argument shows that if $a^m \vert b^m$ for some $m\geq 2$, then $a \vert b$.
A: To say that $a^2$ divides $b^2$ is to say that $n=b^2/a^2 = (b/a)^2$ is an integer. Now integers only have square roots which are integers or irrational. Since $b/a$ is rational, it must be an integer, which is to say that $a$ divides $b$.
A: Call a positive integer $y$ bad if for some positive $x$, we have $x^2\mid y^2$ but $x \nmid y$. 
If there are bad positive integers, there is a smallest bad one, say $b$. Since $b$ is bad, there is a positive integer $a$ such that $a^2 \mid b^2$ but $a \nmid b$.
It is clear that $a \ne 1$. So some prime $p$ divides $a^2$. But if a prime divides the product $cd$, it divides $c$ or $d$ or both. Thus $p\mid a$.
Since $a^2\mid b^2$, we have $p\mid b^2$, and therefore $p\mid b$. 
Let $a=pa_1$ and $b=pb_1$. Since $a^2\mid b^2$, we have $(pa_1)^2=q(pb_1)^2$ for some integer $q$, and therefore $a_1^2\mid b_1^2$.
But $a_1\nmid b_1$, since if it does, one can easily  show that $a\mid b$.
So we have shown that $b_1$ is bad. It is clear that $b_1\lt b$, which contradicts the supposed minimality of $b$.  
We conclude that there are no bad positive integers. 
A: $a^2 \mid b^2 \Rightarrow \frac{a}{d}\cdot\frac{a}{d} \mid \frac{b}{d}\cdot\frac{b}{d}$ with $d = gcd(a,b)$. From $gcd(\frac{a}{d},\frac{b}{d})=1$ follows $\frac{a}{d}=1$ or $a=d \mid b$.
This can easily be extended to $a^m \mid b^n$ where $2 \le n \le m$.
A: Let, a = $p_1^{\alpha_1}p_2^{\alpha_2} ... p_k^{\alpha_k}$ and b = $p_1^{\beta_1}p_2^{\beta_2} ... p_k^{\beta_k}$  
Then, $a^2$ = $p_1^{2\alpha_1}p_2^{2\alpha_2}... p_k^{2\alpha_k} $ and $b^2$ = $p_1^{2\beta_1}p_2^{2\beta_2} ... p_k^{2\beta_k}$  
Since $a^2|b^2$:
$b^2/a^2$ = $p_1^{2(\beta_1 - \alpha_1)}p_2^{2(\beta_2 - \alpha_2)}... p_k^{2(\beta_k - \alpha_k)} $  
Taking the square root of both sides:
$b/a$ = $p_1^{\beta_1 - \alpha_1}p_2^{\beta_2 - \alpha_2}... p_k^{\beta_k - \alpha_k} $
This implies a|b since $\alpha_i$ and $\beta_i$ are both integers
