The earliest reference is surely Diophantus' Arithmetica. His "method of adequality" can be used to construct rational points on quadrics that approximate real points arbitrarily well (that is, starting from the existence of a rational point).
This is not of course how Diophantus phrases it, but that is what it comes down to. For example, in Book V, Problem 10, he treats the problem of finding rational $x$ and $y$ satisfying $x^2+y^2=9$ and additionally $x^2>2$ and $y^2>6$. Problem 11 asks for rational $x,y,z$ with $x^2+y^2+z^2=10$, with each of $x^2$, $y^2$, and $z^2$ greater than $3$. Similar problems occur twicea couple of times more in the same book, and it is easy to satisfy oneself that the method works in the generality described above. Quite an accomplishment for a mathematician working in the Hellenistic era!
For more, see pp. 95-98 of the excellent monograph
Thomas L. Heath. Diophantus of Alexandria; a study in the history of Greek algebra.
as well as the paper
Mikhail G. Katz, David M. Schaps, and Steven Shnider. Almost equal: the method of adequality from Diophantus to Fermat and beyond. Perspectives on Science, Vol. 21, No. 3, pp. 283-324.