How to understand Apostol's proof of the irrationality of $\sqrt{n}$ if $n$ is not a perfect square? Recently I am reading the textbook of Apostol, Mathematical Analysis, Second Edition. On page 7, there is a theorem 1.10: If $n$ is a positive integer with is not a perfect square, then $\sqrt{n}$ is irrational. Then Apostol gave a proof. But I can not understand the line 4 of its proof:  " However, if $a^2$ is a multiple of $n,$ $a$ itself must be a multiple of $n,$ since $n$ has no square factors $>1.$" I can not figure out  the details here. Actually, I re-express these lines as follows:
Proposition:  Assume $n$ and $a$ are positive integers. If $n$ is not a perfect square and contains no square factor $>1,$ then we have:  $n\mid a$, provided $n\mid a^2.$
I have tried to prove this proposition, but failed. Can anyone give me some clues? 

By the Fundamental Theorem of Arithmetic every integer is the product of a unique set of primes. That is $n = q_1q_2..q_p$. But since $n$ contains no square factors each prime factor is distinct. 
Now $n \ | \ a^2 \implies q_j \ | \ a^2$. By Euclid's Lemma $q_j \ | \ a$. And this is true for all $j = 1, 2, .. p$. Again, since the $q_j$'s are distinct primes $ q_1q_2..q_p \ | \ a \implies n \ | \ a$.
