Odysseus tells Polyphemus his name is "Nobody" to prevent Polyphemus from being able to successfully call for help when Odysseus enacts his escape plan.
When Odysseus and his men are trapped in Polyphemus's cave, he's horrified as the cyclops eats some of his men. To escape, he sharpens a large wooden club and then he convinces Polyphemus to get drunk. Odysseus relates the story, saying, "Three times I poured some out and gave it to him, and, like a fool, he swilled it down."
When Polyphemus is drunk, Odysseus claims his name is Nobody. He says:
"Cyclops, you asked about my famous name.
I’ll tell you. Then you can offer me a gift,
as your guest. My name is Nobody.
My father and mother, all my other friends—
they call me Nobody."
That’s what I said.
His pitiless heart replied:
I’ll eat all your companions before you
and have you at the end—my gift to you,
since you’re my guest."
Polyphemus then passes out from the wine, vomiting wine and parts of dead men. Odysseus and his crew use the wooden stake to blind him. Then Polyphemus calls for help -- which Odysseus anticipated and which was the reason Odysseus gave Polyphemus a fake name.
Polyphemus's friends come in response to his screaming and when they ask what's wrong, he says, "Nobody is killing me, my friends, by treachery, not using any force." His friends, therefore, think he's just ill and go away, leaving him in his cave and allowing Odysseus and his friends to escape by clinging to the bottom of sheep exiting the cave so Polyphemus can't feel them.
After he's successfully escaped, though, Odysseus is reckless and admits his true name to Polyphemus. The result of this is Polyphemus's father Poseidon sending a storm to wreck Odysseus's ship as revenge.