What is Hamlets plan, and what excuse does he give for putting on the play before he takes his revenge?
Hamlet wants to ascertain that Claudius is, in fact, responsible for the murder of his father. The plan is to reenact, through the play, a scene that is more or less identical to the way (according to the ghost) King Hamlet was murdered by Claudius. Hamlet hopes that Claudius will react in such a way as to confirm his suspicions. "The play's the thing," he tells himself at the end of Act II, "wherein I'll catch the conscience of the King." He even tells Horatio to watch his uncle, saying that
If his occulted guilt
Do not itself unkennel in one speech,
It is a damned ghost that we have seen...
So Hamlet says he wants to be absolutely certain that Claudius is guilty of the crime before he seeks revenge. It is a bit of an elaborate scheme, and one that is certainly in keeping with his rather roundabout way of avenging his father's death. It is pretty obvious at this point in the play that Hamlet is still grappling with the morality of seeking revenge. But the plot works exactly as Hamlet hoped--the King is horrified by the scene, and even leaves, ending the play. Hamlet and Horatio both witnessed the King's reaction, and leave convinced that he was, in fact, the murderer. Even then, however, Hamlet still finds a reason to forestall revenge--in the next scene, he encounters the King on his knees in prayer, and fears that his soul might go to heaven if he is murdered while praying.