Let $a$, $b$ be positive integers. Clearly if $a\mid b^2$, $ak = b*b$ for some $k$ in $\mathbb{Z}$. Intuitively, $a$ will be the gcd so it must be $1$. But how can I show this? Is there a more appropriate way to phrase this or maybe some mathematical simplification or steps I can see?
Thanks!
Also, when I get to $a = 1$, how can I show that $b$ also must be $1$?
Hint: Note that $a\not\mid b\implies b=ka+r,\ r\in {1,2,\cdots, a-1}\implies b^2\equiv j \mod a$ with $j\ne 0$.
Edit: Note that as per my answer $(a,b)=1\implies a=\pm 1$.