Hamlet says he has learned that people can smile and betray you, because his uncle murdered his father.
In this scene, Hamlet has just had a conversation with his father’s ghost. In this sad conversation, he learned that his father was murdered by his uncle, Claudius. This is terrible news. He has been living in his uncle’s house (okay, castle) the entire time, and he never knew that his uncle betrayed his father this entire time. Hamlet has really learned a terrible life lesson here. Hamlet shares this lesson in a soliloquy.
My tables—meet it is I set it down
That one may smile, and smile, and be a villain;
At least I am sure it may be so in Denmark.
So, uncle, there you are. (Act 1, Scene 5)
Hamlet is frustrated and angry. You would be too if you had just learned this. Really, it is quite a lot of information to take in. First of all, I imagine having a conversation with one’s dead father’s ghost is a bit unsettling. Then, to learn that your father was killed by his brother, and let it sink in that that brother married your mother, would be devastating to say the least.
Hamlet is getting a lesson that we must all get as we grow up. I imagine it is doubly so in a royal palace, where politics are nasty. It is true of life in general though. People can smile to your face while they betray you. Hamlet now has to deal with this information. His father has a clear idea of what he wants Hamlet to do.
If thou hast nature in thee, bear it not.
Let not the royal bed of Denmark be
A couch for luxury and damned incest. (Act 1, Scene 5)
He has been charged by his father to get revenge on the king. He has to take out the new king. He is supposed to leave his mother be, even though he calls her “pernicious woman.” (Hamlet is not happy with his mother right now.) His father’s ghost does not blame her, which Hamlet should find interesting. He is supposed to kill the king.
So the lesson is to be careful who you trust, whether in a royal palace or in day to day life. People can smile at you while they stab you in the back. It is not a cheery thought, but your Shakespeare life lesson for the day. I guess part two of the lesson is to make sure you get revenge quickly, so that everyone in the play does not die by Act 5.