Many car issues are easy to determine but others are more elusive. Issues with an O2 sensor or Air Fuel Ratio Sensor can be extremely difficult to determine. Many a time the ECU will determine that the car is having an issue but when it comes to o2 sensors that issue may not be where the ECU says it is. More like the issue is being detected where the O2 sensor is.
When there is an issue internally with an engine the sensors are the first place that will show the signs of the problem. The reason for this is simple, all of the gasses leaving the engine pass these sensors and if there is excess fuel or burnt off oil it will be deposited on the oxygen sensor causing failure. A failure of the o2 sensor will require replacement of the unit but it will also require the other issues to be fixed before the sensor is installed. If the other issues are not taken care of the o2 sensor is going to fail again and most parts suppliers will not warranty a part with foreign debris build up on the unit. Many times the issue that are causing the failure of the sensor and much larger than the electrical system many involve the fuel system or oil being burned off in the motor. A good example, when a turbo is failing it may send a large amount of oil though the engine and the left over burnt oil has to go somewhere after the ignition in the cylinder. The oil travels through the down pipe where it hits the sensor and not only gives a bad reading but also cakes on destroying the unit as well. These are just a few of the issues that can cause debris build up on the sensor and it is recommended by almost everyone in the car industry to take you to be inspected by a mechanic before buying parts like an O2 sensor.