Show that an irreducible fraction $x/y$, where $x, y$ are natural numbers, is the sum of the squares of two rationals numbers if and only if each of the numbers $x, y$ is the sum of the squares of two integers.
I showed $"\Leftarrow"$ and don't know how to show $"\Rightarrow"$.
Assume $$\frac{x}{y}=(\frac{a}{b})^2+(\frac{c}{d})^2=\frac{a^2d^2+b^2c^2}{b^2d^2}$$
If a prime $p$ divides $b^2d^2$ and $a^2d^2+b^2c^2$, then $p|b$ or $p|d$. Hence $p|ad$ or $p|bc$. This impies that $p$ divides $ad$ AND $bc$. Hence numerator and denominator are divisible by $p^2$. The squares remain squares, and we can continue until the fraction is irreducible.