Hamlet stages The Mousetrap—a play-within-a-play that reenacts his father's murder as described by the Ghost. During the performance, he intensely observes Claudius's reaction. The king's visible guilt—pallor, agitation, and abrupt departure from the performance—confirms the Ghost's accusation. This theatrical test provides the pivotal evidence Hamlet needs.
Beyond the play, Hamlet also uses his soliloquies to process the moral implications and corroborates his findings through others' observations, particularly Horatio's confirmation of the Ghost's appearance and Claudius's subsequent behavior (prayer scene, plotting with Laertes). The "play within a play" remains the dramatic and evidentiary centerpiece.