Suppose a, b, c are positive integers such that (a, b) = 1 and ab=c^2. Prove that each of a, b is the square of an integer. 
Suppose $a,$ $b$ and $c$ are positive integers such that $(a, b) = 1$ and $ab=c^2$. Prove that each of $a$, $b$ is the square of an integer.

I've tried breaking down $c^2$ into its prime factors and having each exponent being multiplied by $2$ since $c$ is squared. I get stuck trying to figure out the connection from that to a and b though.
 A: We have
$$a=a_1^{k_1}\cdot a_2^{k_2}\cdots a_n^{k_n}$$
and
$$b=b_1^{h_1}\cdot b_2^{h_2}\cdots b_m^{h_m}$$
where $b_i$ and $a_i$ are respected prime factors. 
Thus
$$a\cdot b=a_1^{k_1}\cdot a_2^{k_2}\cdots a_n^{k_n}\cdot b_1^{h_1}\cdot b_2^{h_2}\cdots b_m^{h_m}=c^2$$
Since $gcd(a,b)=1$, we know that
$$\forall_{i,j}(a_i\ne b_j)$$
$$\implies$$
$$(a_1^{\tilde{k}_1}\cdot a_2^{\tilde{k}_2}\cdots a_n^{\tilde{k}_n})^2\cdot (b_1^{\tilde{h}_1}\cdot b_2^{\tilde{h}_2}\cdots b_m^{\tilde{h}_m})^2=c^2,$$
where 
$$k_i=2\tilde{k_i}\land h_j=2\tilde{h_j}.$$
In plain tongue, this means that all powers $k_i$ and $h_j$ must be divisible by $2$, which completes the proof.
A: Let $a=p_1^{\alpha_1}p_2^{\alpha_{2}}...p_n^{\alpha_n}$ and $b=p_1^{\beta_1}p_2^{\beta_{2}}...p_n^{\beta_n}$, where $p_i$ are different primes and $\alpha_i\geq0$ and $\beta_i\geq0$ are integers.
Thus, since $gcd(a,b)=1$, we have $\alpha_i\beta_i=0$ and $\alpha_i+\beta_i$ is even, 
which says that all $a_i$ and $\beta_i$ are even we are done! 
