sums of rational squares It is a well-known fact that if an integer is a sum of two rational squares then it is a sum of two integer squares.  For example, Cohen vol. 1 page 314 prop. 5.4.9.   Cohen gives a short proof that relies on Hasse-Minkowski, but he attributes the theorem (without reference) to Fermat, who didn't have Hasse-Minkowski available.   So my question is,  how did Fermat prove this theorem?  and part 2 of the question is,  what is the simplest direct proof?   I googled for this result and found a manuscript with a proof that doesn't use Hasse-Minkowski, but it's not very short.

In his early days, Fermat realized that a natural number that can
be written as a sum of two rational squares actually is a sum of
two integral squares, but he did not come back to this claim 
when eventually he discovered the proof of the Two-Squares
Theorem. The result in question can be proved with the methods
available to Fermat, as I will show here.
Theorem 1 If $n$ is a sum of two rational squares, then
every prime $q = 4n+3$ divides $n$ an even number of times.
Theorem 2 Every prime number $p = 4n+1$ is the sum of two
integral squares.
Now we invoke the product formula for sums of two squares
$$ (a^2 + b^2)(c^2 + d^2) = (ac-bd)^2 + (ad+bc)^2. $$
It implies that every product of prime numbers $4n+1$ and some 
power of $2$ can be written as a sum of two integral squares, 
and multiplying through by squares of primes $q = 4n+3$, the 
claim follows.
Proof of Theorem 1
We will show that primes $p = 4n+3$ do not divide a sum of two 
coprime squares.
Assume that $p \mid x^2 + y^2$  with $\gcd(x,y) = 1$. 
Reducing $x$ and $y$ modulo $p$ we may assume that 
$-p/2 < x, y < p/2$; cancelling possible common divisors 
we then have $p \mid x^2 + y^2$ with $\gcd(x,y) = 1$ and 
$x^2 + y^2 < \frac12 p^2$.
If $x$ and $y$ are both odd, then the identity
$$ \Big(\frac{x+y}2\Big)^2 + \Big(\frac{x-y}2\Big)^2 = \frac{x^2+y^2}2 $$
allows us to remove any remaining factor of $2$ from the sum, and we
may therefore assume that $a^2 + b^2 = pr$ for some odd number $r < p$.
Since $a$ and $b$ then have different parity, $a^2 + b^2$ must have the
form $4n+1$, and therefore the number $r$ must have the form $4n+2$.
But then $r$ must have at least one prime factor $q \equiv 3 \bmod 4$, 
and since $a^2 + b^2 < p^2$, we must have $q \le r < p$.
Thus if $p \equiv 3 \bmod 4$ divides a sum of two coprime squares,
then there must be some prime $q \equiv 3 \bmod 4$ less than $p$ with the
same property. Applying descent we get a contradiction.
Proof of Theorem 2


*

*The prime $p$ divides a sum of two squares.
For every prime $p = 4n+1$ there is an integer $x$ such that
$p$ divides $x^2+1$. 
By Fermat's Theorem, the prime $p$ divides
  $$ a^{p-1}-1 = a^{4n}-1 = (a^{2n}-1)(a^{2n}+1). $$
If we can show that there is an integer $a$ for which $p$
does not divide the first factor we are done, because
then $p \mid (a^n)^2+1$. By Euler's criterion it is sufficient 
to choose $a$ as a quadratic nonresidue modulo $p$. Equivalently
we may observe that the polynomial $x^{2n}-1$ has at most $2n$
roots modulo $p$.   

*The descent. The basic idea is the following: Assume that the prime number 
  $p = 4n+1$ is not a sum of two squares. Let $x$ be an integer 
  such that $p \mid x^2 + 1$. Reducing $x$ modulo $p$ shows that
  we may assume that $p \mid x^2+1$ for some even integer $x$ with
  $0 < x < p$. This implies that $x^2+1 = pm$ for some integer 
  $m < p$. Fermat then shows that there must be som prime divisor 
  $q$ of $m$ such that $q$ is not a sum of two squares; since 
  prime divisors of sums of two coprime squares have the form
  $4n+1$, Fermat now has found a prime number $q = 4n+1$ strictly
  less than $p$ that is not a sum of two squares. Repeating this
  step eventually shows that $p = 5$ is not a sum of two squares,
  which is nonsense since $5 = 1^2 + 5^2$. 
Assume that $p = 4n+1$ is not a sum of two squares.
  We know that $pm = x^2 + 1$ is a sum of two squares for some
  odd integer $m < p$. By Theorem 1, $m$ is only divisible
  by primes of the form $4k+1$. We now use the following
Lemma Assume that $pm = x^2 + y^2$ for coprime integers $x, y$, 
and let $q$ be a prime dividing $m$, say $m = qm_1$. If $q = a^2 + b^2$ 
is a sum of two squares, then $pm_1 = x_1^2 + y_1^2$ is also a sum of two 
squares.
Applying this lemma repeatedly we find that if every $q \mid m$ is a 
     sum of two squares, then so is $p$ in contradiction to our assumption. 
     Thus there is a prime $q = 4k+1$, strictly smaller than $p$, which is 
     not a sum of two squares, and now descent takes over.
It remains to prove the Lemma. To this end, we have to perform 
    the division $\frac{x^2+y^2}{a^2+b^2}$. By the product formula
    $$ (a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (bc+ad)^2 $$ 
    we have to find integers $c, d$ such that $x = ac-bd$ and $y = bc+ad$.
Since $q \mid (a^2 + b^2)$ and $q \mid (x^2 + y^2)$ we also have
    $$ q \mid (a^2+b^2)x^2 - (x^2+y^2)b^2 
      = a^2x^2 - b^2y^2 = (ax-by)(ax+by). $$
Since $q$ is prime, it must divide one of the factors. Replacing $b$ 
    by $-b$ if necessary we may assume that $q$ divides $ax-by$. We know 
    that $q$ divides $a^2 + b^2$ as well as $pm = x^2 + y^2$, hence $q^2$ 
    divides $(ax - by)^2 + (ay+bx)^2 $ by the product formula. Since $q$ 
    divides the first summand, it must divide the second as well, and we 
    have $pm_1 = (\frac{ax-by}q)^2 + (\frac{ay+bx}q)^2$. 
