The soliloquies in Shakespeare's Hamlet allow the author to introduce Hamlet to the audience. Each speech permits us to understand not only what Hamlet is going through, but to see firsthand the effects of his uncle's murderous mindset—especially Hamlet's sense of loneliness and isolation, having lost his father and believing he cannot trust anyone.
The depth of Hamlet's despair is painfully obvious as he wishes he could just disappear, and laments his inability to take his own life because God has forbidden such an act. This is found in Act One, scene two, before Hamlet is even aware that his father has been murdered:
O, that this too too sullied flesh would melt,
Thaw and resolve itself into a dew,
Or that the Everlasting had not fix'd
His canon 'gainst self-slaughter! (132-135)
However, this idea is not put to rest. In Act Three, scene one, we find perhaps Hamlet's most famous soliloquy: his "To be or not to be..." speech, where he contemplates suicide again—whether or not it would just be easier to die. However, as indecision plagues him as to how best to avenge his father's death, Hamlet is haunted by what he does not know about the afterlife. Once again, the soliloquy allows the audience to have a closer look at what makes Hamlet so human as he struggles to do the right thing:
To be, or not to be, that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune
Or to take arms against a sea of troubles,
And by opposing end them. To die, to sleep... (63-67)
...To die, to sleep—
To sleep—perchance to dream. Ay, there's the rub!
For in that sleep of death what dreams may come... (71-73)
Shakespeare's soliloquies in Hamlet permit the audience to "hear" the young prince's deepest thoughts. He speaks freely and honestly, without worrying about anyone else's feelings: he is basically talking to himself so the audience can hear.
Besides receiving more information about Hamlet, these soul-searching segments of the play allow the audience to better understand this son's dilemmas; they ask us to care about this man who has lost so much, and whose fate leads to tragedy as he attempts simply to keep a promise to his father. For example, we are more sympathetic as we watch Claudius and his "minions" play at a game in which Hamlet has no experience.
The soliloquies present the audience with the inner-workings of Hamlet's heart and mind. In knowing him and caring about him, the play is more powerful, especially as we witness Hamlet's death. In the soliloquies, the members of the audience are perhaps better able to recognize parts of themselves that are so similar to Hamlet. This play is particularly powerful because Hamlet's pain, sense of loss, loneliness, and his disappointment in the actions of others, mirror our own fears, disappointments and feelings of isolation. It is the job of the soliloquy to provide information in a drama by allowing the characters to speak about their hidden feelings, ideas, emotions, etc., allowing the audience a clearer understanding of the play and its characters.