I have had oil go very nasty rancid-- particularly nut/seed oil. Or oil that's been used for deep frying too many times can get too yucky to use again... not that any of us should be deep frying that much.
I honestly don't know if the average backyard composter can successfully compost vegetable oils. I do know of a guy who has been successfully composting literally every iota of organic material that his household produces (including human output, entire chicken caracasses, gallons of lees from wine-making) for 20+ years, but then he's far from the average backyard composter.
If you find you don't have success composting vegetable oils, the other things I can think of to do with it are seal it in a container and put it in the trash, or put it down the drain with plenty of water... or use it to power the nearest oil lamp. I honestly don't remember which one I did with my rancid oil, but I've never had gallons and gallons of it-- just a few ounces.
If you can find a cooperative owner/manager, restaurants (especially fast food places) might allow you to add it to their own waste oil container. A grease-disposal company removes the used oil and it gets recycled into biodiesel, lubricants, and other materials that can be substituted for petroleum-based products in manufacturing. Some municipalities offer free oil recycling also, so check with your local authorities.