A plant kept under a belljar (otherwise sealed off from the environment) will do just fine as long as it gets enough sunlight (and starts with enough soil and water). It will produce oxygen during the day and consume that very same oxygen during the night. (I realize that this is a simplification.)
The only reason we have a net PLUS of oxygen in our atmosphere is because - can you guess? - the SINK of the biomass in the plants, themselves. When that biomass dies and is allowed to decay, it will "take up" all of the free oxygen that it once generated in life. The only way to maintain a net plus is to remove the biomass from the biosphere - e.g., to prevent it from rotting, by fossilizing it.
Your biology lesson for today.
Regards,