Quaffing this potion is not useful and in fact abuses your wisdom ("That was smooth!" or, if cursed, "This tastes like castor oil.") It has other uses, however. One use is to untrap a squeaky board, similar to a can of grease.
Some uses involve lighting the oil by applying the potion. A lit potion of oil can be thrown at an enemy to cause 4d4 fire damage or thrown up to cause fire damage to yourself, removing slime; no damage is incurred if unlit. A lit potion of oil is dangerous when quaffed - it deals 3d4 fire damage and abuses wisdom unless you are polymorphed into a monster that likes fire (note: this is not the same as intrinsic fire resistance, although that will reduce the damage taken to 1d4). Monsters that like fire include fire vortices, flaming spheres, salamanders, and fire elementals. A lit potion of oil can be snuffed by applying it again.
Oil can also be used to fix damaged weapons. By dipping a rusty or corroded weapon into a non-cursed potion of oil, it loses one measure of erosion damage. To completely repair a thoroughly corroded weapon, you thus need three potions of oil: from thoroughly corroded to very corroded to corroded to uncorroded. Oil does not repair rotten or burnt weapons, nor does it repair damaged armor.
A potion of oil can be used to refill an empty oil lamp, by #dipping the lamp in the potion. However, if you attempt to do this while either the lamp or potion is lit, the potion will be wasted. (If the lamp is lit and the potion is not, the potion will explode!) Magic lamps behave just like oil lamps in this respect, so you can't identify them with oil.
Attempts to use a cursed potion of oil can cause the oil to spill over your fingers, making them too slippery to hold a weapon. If this happens in a shop, the shopkeeper will consider your weapon his newfound property. This is another reason not to apply potions in shops. Applying a towel cleans your hands and removes this effect.
Identifying a potion of oil is easy: just try to apply every new potion you find. If the potion lights, it's oil, and autoidentifies. Do not do this in a shop, or you will be forced to pay for the potion and will be charged Yendorian Fuel Tax.
If you start the game with an oil lamp, the potion of oil is already identified for you.
Dipping a unicorn horn into a potion of oil produces the message "Your unicorn horn gleams with an oily sheen" and the potion of autoidentified.