You may have missed the fact that this requires you to split all rational numbers (that is numbers which can be written as $\frac{a}{b}$ with $a$ an integer and $b$ a positive integer where they have no common factor above $1$) into two subsets.
If you divide them into two sets where the lower set is everything negative or whose square is less than or equal to 25, you will find numbers like $-1, 5, \frac{3}{2}, \frac{500}{101}$ in the lower subset and numbers like $6, 999, \frac{5000}{999}$ in the upper subset.
If you divide them into two sets where the lower set is everything negative or whose square is strictly less than 25, you will find numbers like $-1, \frac{3}{2}, \frac{500}{101}$ in the lower subset and numbers like $6, 5, 999, \frac{5000}{999}$ in the upper subset.
If you divide them into two sets where the lower set is everything negative or whose square is less than 2, you will find numbers like $-1, 1, \frac{141421}{100000}$ in the lower subset and numbers like $6, 2, \frac{141421357}{100000000}$ in the upper subset.
A nice generalization of the fundamental theorem of arithmetic is that every rational number is uniquely represented as a product of primes raised to integer powers. For example:
$$\frac{4}{9} = 2^{2}*3^{-2}$$
This is the natural generalization of factoring integers to rational numbers. Positive powers are part of the numerator, negative powers part of the denominator (since $a^{-b} = \frac{1}{a^b}$).
When you take the $n$th root, you divide each power by $n$:
$$\sqrt[n]{2^{p_2}*3^{p_3}*5^{p_5}...} = 2^{p_2/n}*3^{p_3/n}*5^{p_5/n}...$$
For example:
$$\sqrt{\frac{4}{9}} = 2^{2/2}*3^{-2/2} = \frac{2}{3}$$
In order for the powers to continue being integers when we divide (and thus the result a rational number), they must be multiples of $n$. In the case where $n$ is $2$, that means the numerator and denominator, in their reduced form, are squares. (And for $n=3$, cubes, and so on...)
In your example, when you multiply the numerator and denominator by the same number, they continue to be the same rational number, just represented differently.
$$\frac{2*4}{2*9} = 2^{2+1-1}*3^{-2} = 2^{2}*3^{-2}$$
You correctly recognize the important of factoring, though you don't really want to use it in your answer. But the most natural way to test if the fraction produced by dividing $a$ by $b$ has a rational $n$th root, is to factor $a/b$ and look at the powers. Or, equivalently, reduce the fraction and determine if the numerator and denominator are integers raised to the power of $n$.
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.