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?