monitor O2 sensors to determine whether front or back sensors is in trouble. you must have OBD II reader to check the live data. If one of the O2 sensors' graph is flat, that O2 sensor need to be replaced. O2 sensor controls air/fuel mixture. If they are not working, you will most likely have problems like what you mentioned here.
Estimate cost: $70 for OEM sensor. Labor: $20 - 30. Total: around $100