The snow in Antarctica does not melt, but becomes compressed when additional snow falls on top of it. Snow crystals compact together until they form a solid ice matrix, trapping air in tiny bubbles. These bubbles contain gases from our atmosphere long ago.
After a core is taken, its layers are dated (you'll learn more about ice core dating soon), and a sample representing a specific time period is crushed into small pieces to allow all the gas bubbles to break down and the gas to escape. The gases are often separated by gas chromatography and carbon dioxide concentration is measured by either infrared spectroscopy or mass spectrometry.
Next, isotope ratios of water molecules in ice samples can be measured to determine historical temperatures.