Check engine light comes on on 2005 Hyundai Elantra

was told rear oxygen sensor needs to be replace but after driving for a while check engine light comes on again.

Asked by for the 2005 Hyundai Elantra
So did you have the O2 sensor replaced or just cleared the code?
Yes. Sensor was replaced.
And the returned code is the same as before O2 sensor replacement? What code (P----#) is present?
Replaced sensor with Hyundai part. Code cleared but occasionally code PO420 comes back.