The brief answer to this is that Odysseus is afraid that Polyphemus will go and destroy Odysseus's ship if he knows where it is. This would leave Odysseus and his men with no way to get off the island of the cyclopes.
By the time that Polyphemus asks Odysseus how he got to the island and where his ship is, Odysseus knows that Polyphemus is trouble. Polyphemus hasn't killed anyone yet, but he has talked about how he defies all of the gods because he and the other cyclopes are so much stronger than the gods. You can see why Odysseus would be suspicious of such a person.
So, because Polyphemus seems like he's probably uncivilized and violent, Odysseus does not tell him where the ship is. Odysseus is afraid that Polyphemus will destroy the ship and take away Odysseus's chance of getting off the island.