The tale of Odysseus and Polyphemus contains what may very well be the first known bad joke.
Odysseus and his party enter the Cyclops' cave, and - finding its occupant out tending his sheep - set about eating the excellent cheeses they find there. Unfortunately, Polyphemus returns before they finish, and soon asks where their ship is moored. Odysseus, ever crafty, replies that it was smashed to flinders on the cliffs, at which point Polyphemus snatches up two men and messily devours them. He then blocks the entrance to his cave with a huge boulder and goes to sleep, knowing that the Achaeans can't move it and thus won't dare to kill him in his sleep.
Odysseus comes up with his clever plan - first he carves Polyphemus' club into a spear and hardens its point in the fire, before getting the cyclops drunk. The giant is pleased with the wine given him, and asks to know Odysseus' name, so that he can offer him a suitable guest-gift. Odysseus replies:
"So, you ask me the name I'm known by, Cyclops? I will tell you. But you must give me a guest-gift as you've promised. Nobody - that's my name. Nobody - so my mother and father call me, all my friends."1
The cyclops, greatly amused by Odysseus' odd name, promises to eat him last as his gift, and then passes out. Our hero and his men waste no time, heating their improvised spear to red-hot intensity and savagely driving it into the sleeping cyclops' eye. Polyphemus roars in agony and bellows for help from the other cyclops on the island, at which point they ask him:
"What, Polyphemus, what in the world's the trouble? Roaring out in the godsent night to rob us of our sleep. Surely no one's rustling your flocks against your will, surely no one's trying to kill you now by fraud or force?"
The stricken Polyphemus replies:
"Nobody, friends... Nobody's killing me now by fraud and not by force!"
At any rate, the other cyclops - convinced that nothing is wrong - leave Polyphemus to his own devices. He seeks to keep the men in his cave by feeling the backs of the sheep as they go out, but as previously mentioned the Achaeans cling to the undersides of the sheep and escape. Odysseus and his men flee to their ship and sail away, as the blinded cyclops hurls giant boulders after them in impotent (and understandably inaccurate) fury. Unfortunately, Odysseus can't stand leaving his cleverness and great humor anonymous, and calls out:
"Cyclops - if any man on the face of the earth should ask you who blinded you, shamed you so - say Odysseus, raider of cities, he gouged out your eye, Laertes' son who makes his home in Ithaca!"
Oops. Polyphemus, now knowing his assailant's true name, is able to pray to his father Poseidon, and bring about the troubles that plague the Greeks on their way home. And thus ends the tale of Polyphemus, and the original hokey play on words.
1This quote, and all others in this writeup, are from Robert Fagles' 1996 translation of the Odyssey which - in my opinion - is the best around.