In Hamlet's speech, "To be or not to be", what is the dramatic irony?
In Shakespeare's Hamlet, there is dramatic irony in the "To be or not to be..." speech.
The speech itself is a question of whether he should go on living or if he should take his life.
He is deeply saddened at the loss of his father, finds out it is really murder, that the killer is his uncle—who has married Hamlet's mother—and the job of seeking vengeance has been charged to Hamlet by his father's ghost. He also does not want to kill Claudius (his step-father/uncle) if there is a chance the new king can go to heaven, but if Hamlet kills a king mistakenly, he could end up going to hell. Hamlet is not afforded an easy decision.
One irony is that it is a mortal sin to commit suicide, something to fear; on the other hand, Hamlet suggests that death is to be wished for, for the peace and release it offers.
It is also ironic that Hamlet pours so much thought into making this decision—one he cannot make lightly; if he should end his life, he must consider what he knows, but also all that he does not know about "the undiscovered country." At the same time he is wrestling with his decision, he admits that there is a downside to thinking about it too much and making an educated decision. Thinking too much can make the thinker a coward. So that which takes courage to do, can also be the thing that robs one of the courage needed to take the step.
Another irony is that Old Hamlet is dead and cannot be touched by things of this world. Hamlet is very much alive and can lose everything in this life, as in the next, by making the wrong decision. That which will avenge his father's murder is the very thing that could destroy Hamlet.
The very idea that Hamlet is thinking (rather than acting) about thinking about why we as humans don't act is a kind of dramatic irony. We understand that Hamlet has what he perceives to be a monumental task, but as readers we are starting to get a bit frustrated that he isn't doing anything more than planning a play. Then here is Hamlet justifying, or at least his explaining his lack of action by reminding us that the unknown of the future and our conscience keep us from acting and "make cowards of us all." While we can appreciate this thought-provoking idea and see that he is absolutely right, we also know that his delay in acting is probably going to be his downfall.