This is a good question. When answering this question, the first point we need to remember is that our sense of piety is different than the sense of piety in the ancient world. The Greek sense of piety is very relational. In other words, people are pious when they are faithful in relationships, not necessarily moral. This is important when it comes to Odysseus, because he is very mischievous (but pious). There are three examples.
Frist, Odysseus is faithful to his men. He would risk his life for them. So, when his men are turned to pigs by the witch Circe, he rescues them. There is a faithfulness that is clear.
Second, Odysseus is faithful to his wife and the city of Ithaca. No matter how hard his trouble are, he will get home to take his rightful place. And when we consider his hardships, there is a lot of piety.
Finally, he is faithful to his son, Telemachus. He takes care of him and trains him to be a man.