Confusion on last step of Hardy’s proof on the square root of “a rational number with imperfect square component”‘s inability to be a rational number

irrational-numbersproof-verificationradicals

Here is a copy of Hardy's proof:

For suppose, if possible, that $p^2/q^2 = m/n$, $p$ having no factor in common with $q$, and $m$ no factor in common with $n$. Then $np^2 = mq^2$. Every factor of $q^2$ must divide $np^2$, and as $p$ and $q$ have no common factor, every factor of $q^2$ must divide $n$. Hence $n = λq^2$, where $λ$ is an integer. But this involves $m = λp^2$: and as $m$ and $n$ have no common factor, $λ$ must be unity. Thus $m = p^2$, $n = q^2$, as was to be proved. In particular it follows, by taking $n = 1$, that an integer cannot be the square of a rational number, unless that rational number is itself integral.

I understand the reasoning that gets us to this point, but I don't understand what $m = p^2$, $n = q^2$ tells us about anything at all related to the original goal of the proof, which is in Hardy's words:

In fact we may go further and say that there is no rational number whose square is $m/n$, where $m/n$ is any positive fraction in its lowest terms, unless $m$ and $n$ are both perfect squares.

Best Answer

If you understand it so far (up to end of first yellow box of your post) it has then already been shown that if $m/n=p^2/q^2$ then $m=p^2$ and $n=q^2.$ Hardy in the proof assumes that $m/n$ (lowest terms) is the square of a rational. He temporarily calls that rational (before squaring) $p/q.$ He may of course assume $\gcd(p,q)=1, \ \gcd(m,n)=1$ which he does near the start.

At the end he has shown that $m=p^2,n=q^2,$ i.e. the numerator and denominator of $m/n$ are both perfect squares, which is what he's trying to prove.