As far as I know scientists use oxygen isotope 16 to 18 ratio in air trapped in glaciers (or in old foraminiftera shells) as proxy for temperature in the past. I know that $\ce{^18O}$ is heavier, and it precipitates faster, and $\ce{^16O}$ is lighter, and it evaporates faster.
I understand that when it's warmer, there is more evaporation and more heavy isotope left in water. Vapor moves toward poles, where it falls as rain or snow and goes back to water (this doesn't count) or stays in glacier for hundreds of thousands of years.
So when it's warm, we should have more $\ce{^18O}$ in ocean sediments, and less in arctic glaciers, right? So more $\ce{^16O}$ (less $\ce{^18O}$) in glaciers -> warm period.
On the other hand, when it's cold, precipitation occurs earlier while air moves to the poles, and heavy isotope falls down earlier, on bigger latitudes. In the air that goes to the poles there is only little heavy isotope left. So more $\ce{^16O}$ (and less $\ce{^18O}$) in glaciers -> cold period. This is contrary to the above. So how to figure out temperature from ice and sediments cores?