O2 is not bad. If you replace it..you are throwing away money. It's the O2 that is reporting the problem.

171 can be a leak in the exhaust before the sensor. Can be a plug wire sitting on the O2 extension (touching) etc etc.