We first hear of Hamlet's behaving strangely through the words of Ophelia to her father in Act II Scene 1. She says that while she was sewing in her room, Hamlet appeared before her with his jacket open, his hat off, his stockings down, and filthy, with his knees knocking as though he'd just come from hell. He said nothing, but took her wrist and stared at her for a long time, sighed deeply, then left the room, staring at her the whole time.
In Act II Scene 2, he is accosted by Polonius and gives him silly or nonsensical replies--and uses the occasion to insult Polonius. For example, then Polonius asks him who he thinks he is, Hamlet says he is a "fishmonger;" when Polonius says he isn't, Hamlet replies, "I would you were so honest a man."
Later in the same act, suspecting (correctly) that Rozencrantz and Guildenstern have been sent for by his father, Hamlet plays crazy with them, as well: "I am but mad north-north-west: when the wind is / southerly I know a hawk from a handsaw."
After he stabs Polonius through the drapery (arras) in his mother's chamber and "lugs the guts" away, he refuses to tell anyone where he hid the body. Finally, the king seeks him out to ask and Hamlet plays with him, as well, but saying he is "At supper.... Not where he eats, but where he is eaten [by worms]." This qualifies as well as mad behavior insomuch as he behaves as though the accidental murder were nothing at all and he refuses to give even the king a straightforward answer.