Hiccups don't serve a useful function anymore, but they were useful to our very ancient ancestors. Find out how early fish 'hiccuped' in order to breath underwater.
Hiccups are a great way to ruin a good meal, a sad movie, or a first date. They're annoying, sometimes painful, and completely useless. That is, they're completely useless to humans. To early fish and amphibians, the motion of a hiccup was vital to continued survival. Humans' ever-so-great-grandcestors were just beginning to use lungs to crawl out of the water. When roaming the land, they needed to suck air down into their lungs.
When they plunged back into their watery homes, they needed to keep their lungs free of liquid. To accomplish that, they had the ability to close the glottis, the passageway into their lungs. They would muscle closed the glottis, sealing off the lungs when they were underwater. At the same time, they would suck water back, forcing it over their gills to allow them to oxygenate themselves while underwater. The motion would push the closed glottis back and down.
So the motion was as follows: a sudden indrawn breath, meant to pull things into the mouth, and a sudden closure of the airway, stopping anything from actually reaching the lungs. Sound familiar? The motion of a hiccup is what allowed early human ancestors to go from air to water to air again. Today, when we only breathe air and leave water to those in wetsuits, it's just a vestigial twitch.