He waxes desperate with imagination.
Let's follow. 'Tis not fit thus to obey him.
Have after. To what issue will this come?
Something is rotten in the state of Denmark.
Heaven will direct it.
Marcellus:Hamlet Act 1, scene 4, 87–91
Nay, let's follow him. [Exeunt.]
This is one time when the popular misquotation—"Something's rotten in Denmark"—is a real improvement on the original. But you ought to be careful around purists, who will also remember that the minor character Marcellus, and not Hamlet, is the one who coins the phrase. There's a reason he says "state of Denmark" rather than just Denmark: the fish is rotting from the head down—all is not well at the top of the political hierarchy.
There have been some hair-raising goings-on outside the castle at Elsinore. As the terrified Horatio and Marcellus look on, the ghost of the recently deceased king appears to Prince Hamlet. The spirit beckons Hamlet offstage, and the frenzied prince follows after, ordering the witnesses to stay put. They quickly decide to tag along anyway—it's not "fit" to obey someone who is in such a desperate state. In this confused exchange, Marcellus's famous non sequitur sustains the foreboding mood of the disjointed and mysterious action. And it reinforces the point and tone of some of Hamlet's earlier remarks—for example, that Denmark is "an unweeded garden" of "things rank and gross in nature" (Act 1, scene 2). When his father's ghost tells him his chilling tale in scene 5, the prince will realize just how rotten things really are in Denmark.