Note how carbon dioxide (blue) has recently skyrocketed up... this is due to human activity burning coal, oil and gas from the industrial revolution to present.
Carbon Dioxide and Earth's Temperature
The amount of carbon dioxide in the atmosphere has been measured back for many thousands of years. Air gets trapped in ice as it freezes in glaciers. By drilling deep cores in the oldest ice fields, then analyzing the trapped air, we know that carbon dioxide has been in a repeating cycle during the last 700,000 years.
We also know that the temperature of earth goes up and down with the levels of carbon dioxide in the atmosphere. This is because of the property of carbon dioxide that makes it trap heat on earth, the so-called greenhouse effect.
There is a complex carbon cycle on earth that determines how much carbon dioxide is in the air. It depends on how much coal, gas and oil are burned, how much carbon dioxide is dissolved in the oceans, how life is absorbing carbon, among other things.