The oxygen sensor (or O2 sensor) is in the exhaust stream (there's usually two of them) and monitors the oxygen content of the exhaust gases. It then sends a signal to the engine computer, which adjusts fuel metering accordingly. Signs of a failing O2 sensor can include black smoke from a rich fuel mixture, surging, rough-running, hard starting, poor idle, poor fuel economy, loss of power and an illuminated Check Engine light. A failed O2 sensor can make your vehicle's exhaust go far enough out of spec to fail emissions, so don't put off changing it.
The oxygen sensor was one of the first innovations in emission control, starting in the early- to mid-80s. The O2 sensor consists of platinum-coated ceramic elements that monitor the content of exhaust gases as they flow through the system. The O2 sensor sends a voltage reading back to the engine computer, which then interprets this reading to determine fuel metering and emissions. There's usually an O2 sensor before the catalytic converter (upstream) and below the catalytic converter (downstream).
O2 sensors will usually not last the life cycle of a vehicle without needing to be replaced. A vehicle with a failed O2 sensor will usually run rich, with black smoke from the tailpipe, poor power, and poor performance. A failed O2 sensor will also register a trouble code and illuminate the dashboard Check Engine light, making diagnosis easy with a code reader tool. Don't drive a vehicle with a failed O2 sensor (which also means it won't pass emissions inspection) - shop Advance Auto Parts for OEM-quality O2 sensors from brands like DENSO and Bosch!