After the machines took over, it seems that there is no significant organic life left on the surface of the planet. No sunshine ever reaches the surface, so there is no significant plant life to produce oxygen. The machine cities are unlikely to maintain the delicate balance of the atmosphere, because oxygen is corrosive to them. So, how can it be that there is breathable air on the surface of the planet after so many centuries (millenia?) without photosynthesis?
There would be residual oxygen from the time before sunlight was blocked out. Without sunlight and plants, most oxygen consuming life forms on Earth would have perished within weeks, if not days, which is not enough time to deplete a substantial percentage of the 20% oxygen atmosphere that we enjoy.
The machines would have taken care of the humans and their oxygen consuming industries. Natural oxidation would gradually take oxygen out of the atmosphere, but the Matrix is probably not old enough for this process to have made the air unbreathable.
You might ask what happens when oxygen is consumed by the humans plugged in to the Matrix. This plot hole is related to the plot hole about the viability of human bio-electricity. The only answer we have is that it is "combined with a form of fusion".
Let's do some math, shall we?
According to Wolfram Alpha, a human consumes
- 210 to 240 mL of oxygen (O2) per kg per hour
and weights around
- 62 kg
which results in an oxygen consumption of
- 1/3 m^3/day of oxygen (O2)
According to Wikipedia, 3/4 of the atmosphere are contained in an
which gives us a volume of
- 5.6 * 10^9 km^3 (air)
- 10^9 km^3 (O2)
which results in
of breathing time for one human.
Since there seem to be no fauna (since there is no flora), this means that the handful of people living on earth can do pretty nicely.
You might argue that I didn't take into account the different pressure levels in the atmosphere when computing this (right at the start) but I only accounted for 3/4 of the oxygen that is available in theory. Also, thermodynamics tells us that the oxygen would be distributed across the planet equally, even if consumed only at one point (Zion).
Actually, the comic The Miller's Tale (archived link here) indicates that there is significant plant life left on the Earth's surface. (It is part of The Matrix Comics released by the Wachowskis' company Burlyman Entertainment and was posted on the official website, so it is canon.)
Here are some panels from the comic showing plant life and fungi, and even small animals:
One of the last panels gives possible explanations for the survival of this plant life -- that genetic modifications and/or mutations have helped these "sun-loving plants" survive:
Since there is significant plant life left on the Earth, there is enough oxygen for humans on the surface of the Earth.