Act 3, scene 4 occurs at a point of high tension in Hamlet. The play within a play has recently taken place and both the audience and the characters are on edge as this dramatic confrontation between mother and son unfolds.
When Hamlet confronts Gertrude over her possible role in the death of her late husband and her marriage to Claudius, he is revealing what his suspicions really are. When he mistakenly kills Polonius, he is passing the point of no return. If his play was not enough to reveal him as a threat to Claudius, this act certainly will set off a chain of events that will condemn Hamlet.
As if this is not enough to destroy Hamlet, his interaction with the Ghost is. As Hamlet, in a fit of rage, bombards his mother with insults and accusations, the Ghost appears to remind Hamlet to leave Gertrude alone. Hamlet then directly addresses the Ghost, and it becomes clear that Gertrude can not see it. This leads her to conclude that her son has gone mad. Gertrude's inability to see the Ghost raises some significant questions. It may mean that she is innocent in the king's murder. It may also mean that Hamlet truly is insane, and the ghost is a figment of this insanity.