Odysseus is the protagonist of The Odyssey by Homer, and in many ways he is an exemplary character. He is generally selfless and noble and brave and wise; however, sometimes he does get a bit too full of himself, which of course is another way of saying that he is occasionally a little cocky. The perfect example of both sides of Odysseus can be found in Book IX of the novel.
This book relates, among other stories, the tale of Odysseus and his men landing on the island of the Cyclopes, crude and uncivilized giants who do nothing but tend sheep all day. When they discover a deserted cave, Odysseus's men want to steal from it, but the more prudent Odysseus prefers that they act more civilized and makes the logical but false assumption that the owner of the cave will welcome them when he returns. So, they wait for the cave's owner who eventually arrives.
The monster Cyclops arrives with his sheep and herds them into the cave; behind him he seals the cave's entrance with a giant boulder. Things do not go as Odysseus had planned, or at least hoped. The monster is already angry, but when Odysseus says they are on the island because Poseidon cased them to shipwreck there, he gets even angrier and eats two of the men. (We discover soon that Poseidon is Cyclops's father, which explains a lot.)
The men are helplessly trapped and several more men are eaten. Odysseus works hard to devise a plan, and he comes up with something ingenious. He and his men sharpen a pole, get the monster drunk, and poke him in his eye with the burning sharpened log. Odysseus has cleverly told the creature that his name is "nobody," so when Cyclops screams out in pain and his fellow Cyclopes ask who is hurting him, that is what he screams: "Nobody!" Genius, right?
The plan continues, and Odysseus is able to get his men out of the cave blocked by a giant boulder by tying them to the undersides of the sheep so they cannot be detected but will be freed from the cave. He saves the biggest ram for himself, which might be considered a bit cocky. The men manage to get to their ship as the Cyclops, named Polyphemus, furiously throws a giant rock at the ship and nearly hits it.
Of course this puts the ship in some danger since it is still pretty close to the shore, but things get worse as Odysseus gets more full of himself (cocky). His men try to stop him, but he throws one last taunt at the giant monster, and he holds nothing back:
"Cyclops, if any mortal man ever asks you who inflicted upon your eye this shameful blinding--tell him that you were blinded by Odysseus, sacker of cities. Laertes is his father and he makes his home Ithaca."
Polyphemus does what any son would do--he tells his father what Odysseus did to him. Of course the result of Odysseus's bragging and taunting is that Poseidon really does now have it in for Odysseus and his men, and he promptly begins giving Odysseus and his men almost ten years worth of payback. Better for Odysseus if he had not felt the need to taunt the one-eyed monster and simply been thankful that his wits had saved him and at least some of his men.
A famous isntance of Odysesseus being cocky is when Odysseus taunted the Cyclops. The cyclops entrapped him in a cave and ate some of Odysseus' men. Odysseus stabbed the Cyclops in the eye and they escaped by tieing themselves under sheep. Odysseus thought he was very clever. So he shouted before leaving the island that he was the powerful and very clever. Poesidon, the cyclops' father, heard and got angry. So he cursed Posiedon by making him lost in the waters. This is one of the main reasons why it took Odysseus so long to get home.