To add to what others are saying about cyanobacteria and similar being the primary source of oxygen, you also have to consider that there is a HUGE amount of oxygen in the atmosphere. Even if oxygen production were ceased suddenly, it would take ages to get through it all.
This article argues that, at current world population, it would take a full 4000 years to consume it all:
www.scienceinschool.org/content/world-without-trees
Latest Answers