When should an Oxygen (O2) sensor be replaced? - ALL

An Oxygen (O2) sensor should be replaced if a check-engine light appears and diagnostic trouble codes related to fuel-trim or sensor performance are stored, or if symptoms such as poor fuel economy, failed emissions tests, rough idle, or sluggish acceleration occur. Sensors contaminated by oil, coolant, fuel additives, or physical damage should also be replaced to restore accurate air-fuel-ratio control.