The only way to extract carbon from the primitive atmosphere of a planet is to break the abundant CO2 molecules. This process necessarily releases oxygen.
This is exactly what happens on Earth : the chlorophyll of the plants, with sunlight, changes CO2 into a carbon-based biomass and releases the oxygen that we need.
On the other hand, if the oxygen production by living beings were not continous, oxygen would disappear rapidly in the form of rust, via the oxidation of rocks.
Finally, we do not know any natural abiotic (i.e. without the intermediary of life) mechanism for the production of oxygen on a planet.
Therefore, astro-biologists today think that if we detect some oxygen and some water on a planet, then the occurrence of life is highly probable.