Not actual car

So, Oppo, I’d like some advice about a car.

Today I went and looked at an Infiniti G35 sedan, manual, RWD. It was in good shape considering its age and mileage. I drove it, and it was very well composed on the road, powerful, comfortable, blah blah blah. It had a pretty nice price on it.

Here’s the trouble. About 40k miles ago, it threw a check engine light. The guy selling it says that this was because of an O2 sensor (not a big deal). However, it still has a check engine light - and the guy says it’s because they still haven’t fixed that O2 sensor. For 40k miles.

I’m a bit sketched out by all of this, so, what’s your opinion? Should I bother spending the money taking it to a mechanic and having it checked out? Or should I just walk away?