Very well could be bad gas. Do you have a chip? I found out after being chipped, my car doesn't like wal-mart gas. Have you ever replaced your pcv valve? You should get this alex pepper's scanner
www.obd-2.com could help you diagnose a problem. Could be o2 sensor, but I doubt that very highly,, even if you end up replacing the sensor, something causes the sensor to go bad and is the true cause of your problems.