The problem of representing a number as a sum of two or four squares is discussed in chapter 20 of Hardy and Wright [HardyWright]. A first elementary proof of Lagrange's Theorem, essentially due to Euler, is given in §20.5. A second proof making use of integer quaternions goes back to Hurwitz in 1919. Their third proof, also elementary, a proof of Jacobi's Four Square Theorem, makes use of theta functions and goes back to Ramanujan.
A more recent elementary proof was discovered by Andrews, Ekhad and Zeilberger [Andrews1993].