I have mazda protege 2000 car runs good but check ingine light came I checked
and I get P0171 code mixture too lean. I dont know what does it means
have I replace air flow sensor or air filter?
how can I check that air flow sensor is still good?
I have cleared the code but check ingine light did not come again
Most of the time P0171 will set if air flow meter gets contaminated by dirt or oil.
You should first make sure there are no vacuum leaks. I have diagnosed this code many times and 95% of the time I have to replace the flow meter Mazda dose offer a rebuilt unit and some car's are covered under 7 year 70,000 mile warranty.