The ancient world hadn't worried much about underwear. The Mediterranean summers were hot, and two thousand years before air conditioning, one preferred to have as much of one's body as possible cooled by the breeze.
The normal outfit for a man in ancient Greece was a simple piece of cloth wrapped around the torso, going under one arm and pinned at the other shoulder. It was held in place with a belt and stopped somewhere in mid-thigh. Men must thus have flashed their manly manliness with almost every step. In a society that believed athletic events should be carried out in the nude and that portrayed its gods in the nude, this should not be surprising.
(Greek women wore the same basic outfit, but it was ankle-length and would be pinned or sewed with a few stitches all down the side. We don't know what they had on underneath--they were discreet.)
The Middle Ages however had underwear. The Romans had mocked the breeches the Germanic people wore, but they had to admit they made horseback riding more comfortable. Underwear was however expensive. You probably didn't want wool tight against your private parts, even though wool was the most common and cheapest fabric, so they had to use linen, until (relatively) less expensive imported cotton reached Europe in the twelfth century (silk had been around longer but was of course even more of a luxury).
If a man was not going to get up on a horse, he typically wore a tunic (knee-length or a little shorter) with nothing to speak of underneath except the arrangement (dare I say garter belt?) that held up his stockings. (Medieval tunics, unlike those of ancient Greece, had no vents down the side.) Medieval women always wore a bit more under their skirts, as well as usually a slip or chemise with lace at the neck if they could afford it.
Male monks did not normally wear underwear. The whole purpose of the monastic life was to remove oneself from the world to a life of austere simplicity, and a long, wrapped habit (basically like a bathrobe) was all that was required. However, this could create problems if a monk went out on an errand or had to ride somewhere. Monasteries provided breeches to monks leaving the house (no use causing a scandal if the robe suddenly flew open), but they were supposed to return them once they got back.
Nuns however always had a bit more on under their habits. Heloise, as abbess, complained bitterly to Abelard that the Benedictine Rule that governed monasteries did not give proper attention to the things that went on with women's private parts (she did not go into detail, but we all know what she meant).
As we all snicker about medieval underwear, let us remember that there is still a lively debate about what Scots are supposed to wear under their kilts.
Click here for more on medieval clothing.