replace your thermostat asap. your engine is not running at optimal temp., so yes, that will affect gas mileage. it doesn't hurt to replace the cap and rotor either. if they're sufficiently worn, your spark will likely not be as strong, leading to less than ideal combustion.
bad o2 sensor can affect things as well. see about getting that fixed.