The first we hear of Hamlet's madness is Ophelia's report of Hamlet's crazy behavior in her rooms just a few minutes before hand. In this description we hear about Hamlet NOT speaking, just staring at Ophelia in long and odd ways and the fact that his clothing looks askance (probably not like the prince usually dresses!).
Late in the next scene of the Act 2 we see Hamlet acting crazy in front of the court -- clearly this is a show for the crowd. It is important to note that Hamlet is speaking in prose -- a Shakespearean method of indicating madness in his character at this time. Hamlet is talking what others seem to think is nonsence. He calls Polonius a fishmonger (when he is clearly not one); he makes some odd comments about Polonius having a daughter and how Polonius should worry about her; he makes veiled comments about old people (like Polonius); he speaks in a very absolute manner (about death being "out of air").
A little later we see in his conversation with Rosencrantz and Guildenstern that he is still speaking in prose and telling them that "Denmark is a prison." Thinking that the world is a prison is a sure sign of depression in Shakespeare's time. He explicitely states that he thinks the world is a terrible place to be right now.