If your Mazda 3 Air Flow Meter keeps failing the issue is most likely to much oil on a Mazda performance air filter, or to much blow by from the 3 engine.
The Mazda 3 Oxygen sensor is a critical part of the emmision control system and should be replaced as soon as it fails. Make sure to check the Mazda 3 diagnosics codes for proper replacement of the O2 Sensor.