You can look this up on Wolfram, "The Prime Counting Function." There it is mentioned:
This relation was first postulated by Gauss in 1792 (when he was 15 years old), although not revealed until an 1849 letter to Johann Encke and not published until 1863 (Gauss 1863; Havil 2003, pp. 176-177).
Another historica nugget gone into is: The notation for the prime counting function is slightly unfortunate because it has nothing whatsoever to do with the constant . This notation was introduced by number theorist Edmund Landau in 1909 and has now become standard. In the words of Derbyshire (2004, p. 38), "I am sorry about this; it's not my fault. You'll just have to put up with it."