The early atmosphere
It is thought that it was the volcanic activity of a young Earth that produced gases that formed the Earth's early atmosphere. The early atmosphere is thought to have been similar to that of Mars or Venus today, with a large amount of carbon dioxide and little/no oxygen. There was also a lot of water vapour in the air, which eventually condensed to form oceans when the Earth cooled.
Over time the amount of carbon dioxide in the air was reduced. One way was by the gas dissolving in newly formed oceans, forming carbonates. These then precipitated into sediments.
Another way that the levels of carbon dioxide decreased was due to the growth of algae and primitive plants that used this carbon dioxide for photosynthesis, which consequently produced oxygen - gradually increasing the amount of oxygen in the atmosphere.
carbon dioxide + water → glucose + oxygen
6CO₂ + 6H₂O → C₆H₁₂O₆ + 6O₂
Over a few billion years plants evolved and the percentage of oxygen increased to a level that enabled animals to evolve. This nearly killed all other life on the planet, because of how reactive oxygen can be. This is referred to as The Great Oxygenation event.
The current atmosphere
Today's atmosphere is made of mostly nitrogen, oxygen, carbon dioxide, water vapour, and argon. Depending on location, the water vapour can change - but the other gases' percentages remain almost constant.
Testing for oxygen
The test for oxygen uses a glowing splint, which is inserted into a container of the gas. If the flame reignites, then oxygen is present.
Greenhouse gases in the atmosphere maintain temperatures on Earth high enough to support life. Water vapour, carbon dioxide and methane are all greenhouse gases. They allow radiation from the sun to pass through the atmosphere and warm the Earth. Greenhouse gases 'trap' some of the radiation that is reflected back by the Earth - subsequently releasing the energy back out again to keep the Earth warm.
Too much of these gases can cause temperatures to rise.
Based on peer-reviewed evidence, many scientists believe that human activities (releasing lots of greenhouse gases) will cause the temperature of the Earth’s atmosphere to increase resulting in global climate change. Modelling this is difficult, because climate change is a complex issue. This leads to simplified models, speculation, and opinions that are expressed in the media that may be based on only parts of the evidence and can be biased.
Since about 1850, there has been an increase in the burning of fossil fuels for energy and industry. During this time the world's carbon dioxide levels have been increasing, and since we know burning fossil fuels releases carbon dioxide - this is pretty good evidence that the two are related.
As the levels of carbon dioxide have increased, the average temperature of the Earth's surface has also risen. Whilst there is a strong correlation between the two, correlation doesn't necessarily mean there is a link between the two.
Scientists have been able to show in the lab that carbon dioxide absorbs infrared radiation, and satellites have been able to show that as carbon dioxide levels have increased - less infrared radiation has left the Earth's atmosphere.
Evaluating the evidence
Evidence for historical carbon dioxide levels come from measuring the concentrations of gases trapped in ice cores, the oldest coming from Antarctica (with data going back 800,000 years).
The oldest temperature records for central England date back to 1659, but cannot be used to assess global temperature changes as they are only from one place. Temperature records from around the world have only existed from about 1880. These measurements were also not very accurate.
Methane is a much more powerful (some scientists say up to four times more) greenhouse gas than carbon dioxide, as it is better at absorbing infrared radiation. Methane is the main component of natural gas, and is released into the atmosphere when oil and natural gas are extracted from the ground and then processed.
Livestock (mainly cattle) also produce a lot of methane gas because of the bacteria in their stomachs during digestion. There are similar bacteria found in landfill sites, as well as rice fields.
Effects of climate change
Rising temperatures due to the increase of carbon dioxide and methane in the atmosphere will lead to:
ice at the South Pole and in glaciers will melt, causing global sea levels to rise - this will lead to increased, and/or permanent flooding in some areas
animals will move away from their 'natural' habitats to find cooler areas to live, and some plants/animals may become extinct if they cannot survive the warmer temperatures
weather patterns will begin to change with some areas becoming drier, and others much wetter - and even more extreme weather events like more frequent severe storms and heat waves/droughts
wildlife, and growth of crops, will be affected by the ever-changing weather systems
as more carbon dioxide is released, more will dissolve into water systems lowering the pH - more acidic waters can harm the organisms that live in them
Limiting the impact
Using renewable energy sources can reduce greenhouse gas emissions, although it may not undo the damage already done.
Some people have suggested either collecting carbon dioxide and burying it, or reflecting infrared radiation back into space.
Reducing the impact is probably only a temporary fix, but involves building flood defences, dams, and irrigation systems. These will probably destroy habitats, and will not fix the issues - only cover up the symptoms of a much bigger problem.