Past temperatures are not always directly proportional to atmospheric greenhouse gas concentrations, because they depend on other factors that slowly change with time (like solar intensity and our planet’s tilt). We have been able to reconstruct the near-surface temperature thanks to may different proxies that will be covered below.
The longest time period we have been able to reconstruct a continuous temperature record for is back 2 million years before present. Scientists used over 20,000 different sea surface temperature data points from ocean sediment cores, drilled out of the ocean floor.
From 800,000 years ago to 20,000 years ago, a different dataset corroborates the one mentioned above, coming from Antarctic Ice cores.
The past 11,300 years’ information was acquired by combining many different proxies for temperature, in order to reduce the error that a single type of source creates. These include, ice core gas bubbles, cosmogenic isotopes produced by solar irradiance, ocean sediments, stalagmite/stalactite formations and volcanic sulfates.
Another study covers the period from 2000 years ago to 1880 with higher spatial resolution combining lake and ocean sediments, ice cores and stalagmites, along with tree rings.
Finally, from 1880 to the present day, meteorological records combined with the newer satellite-acquired data gives us precise, highly localized information of land-surface and sea surface temperatures.
Moberg, A., D.M. Sonechkin, K. Holmgren, N.M. Datsenko, and W. Karlén. 2005. Highly variable Northern Hemisphere temperatures reconstructed from low- and high-resolution proxy data. Nature, Vol. 433, pp. 613-617.
Marcott, S.A., J.D. Shakun, P.U. Clark, and A.C. Mix. 2013. A reconstruction of regional and global temperature for the past 11,300 years. Science, Vol. 339. pp. 1198-1201. doi:10.1126/science.1228026. Shakun, J.D., P.U. Clark, F. He, S.A. Marcott, A.C. Mix, Z. Liu, B.L. Otto-Bliesner, A. Schmittner, A., and E. Bard. 2012. Global warming preceded by increasing carbon dioxide concentrations during the last deglaciation. Nature, Vol. 484, pp. 49-54. doi:10.1038/nature10915.
Snyder, C.W. 2016. Evolution of global temperature over the past two million years. Nature, Vol. 538, pp. 226-228.
The 2 degree Institute: https://www.temperaturerecord.org/