While cave diving, one may see air pockets. How can one know whether the air is safe to breathe?
There isn't an easy way of telling if the air in air pockets are safe to breathe, especially in short sumps where cavers might free dive (i.e.dive through by just holding their breath with no air supply) as they may have surfaced in such air bells and breathed whatever oxygen was available. Deaths have occurred in the past due to this happening.
There are small portable multi-gas detectors on the market that if properly cared for might give reliable indications of the quality of the air trapped within a pocket inside a cave. Breaking out that detector while hovering in the water without damaging the detector with water is unlikely.