Oxygen sensor codes don't necessarily mean that the oxygen sensor is bad.
The rear oxygen sensor monitors the cat. In this case, the pre cat in the exhaust manifold. If the rear oxygen sensor is switching nearly as rapidly as the front oxygen sensor, it is assumed that the cat is not working very well. I suspect that this may be your problem, so you need to investigate it a bit more.