O, that this too too solid flesh would melt
Thaw and resolve itself into a dew!
Or that the Everlasting had not fix'd
His canon 'gainst self-slaughter! O God! God!
How weary, stale, flat and unprofitable,
Seem to me all the uses of this world!
Fie on't! ah fie! 'tis an unweeded garden,
That grows to seed; things rank and gross in nature
Possess it merely. That it should come thus!
But two months dead: nay, not so much, not two:
So excellent a king; that was, to this,
Hyperion to a satyr; so loving to my mother
That he might not beteem the winds of heaven
Visit her face too roughly. Heaven and earth!
Must I remember? why, she would hang on him,
As if increase of appetite had grown
By what it fed on: and yet, within a month -
Let me not think on't - Frailty, thy name is woman! -
A little month, or ere those shoes were old
With which she follow'd my poor father's body,
Like Niobe, all tears why she, even she -
O, God! a beast, that wants discourse of reason,
Would have mourn'd longer - married with my uncle,
My father's brother, but no more like my father
Than I to Hercules: within a month:
Ere yet the salt of most unrighteous tears
Had left the flushing in her galled eyes,
She married. O, most wicked speed, to post
With such dexterity to incestuous sheets!
It is not nor it cannot come to good:
But break, my heart; for I must hold my tongue.
A soliloquy is a dramatic device whereby a playwright has a character speak to themselves alone on stage. The word itself comes from Latin (solus, alone, and loquor, I speak...). Shakespeare's plays are filled with countless examples of the form, in comedy, history, and tragedy, and indeed the device has been popular from as far back as the writings of Montaigne (believed to have inspired Shakespeare) all the way as far as contemporary versions of it, such as Netflix' House of Cards.
There is much discussion of suicide in this play. This first of Hamlet's soliloquies starts with his wish to end his life, and the theme will of course be picked up in the more famous 'to be or not to be' soliloquy later in the play. Later in the play it is debated whether or not Ophelia can have a full Christian burial because her death might have been a suicide too - and so the issue haunts the entire play.
Niobe was the mother of fourteen children, but when she bragged about this to Leto, mother of Apollo and Artemis, mocking her for having had only two children, the latter woman was insulted. In revenge for this hubris, Leto's divine children slaughtered all of Niobe's children, and her grief for them made her synonymous with weeping.
Hyperion was one of the Titans, eventually overthrown by the Olympian gods. He was the father of the Sun, the Moon and the Dawn (Helios, Selene and Eos, respectively.)
Seneca's version of Hercules is a complicated, literary play that was very likely written to be read (or read aloud) rather than performed in full. It expands on Euripides' version of the story of Hercules and his madness, imposed on him as punishment by his father's wife Hera. The play (fully titled Hercules Furens) contains passages of extraordinary beauty and a variety of very quotable maxims, but as with most of Seneca's dramatic output doesn't hold its weight on stage.
The great hero Hercules was famous for completing the twelve labours, but in drama it is the darker sides of his story that have been immortalised. Both Euripides and Seneca wrote version of the story of how he was driven mad by the Furies, and in his madness, murdered his own wife and children. As a character particularly associated with dramatic madness, it is perhaps no accident that Hamlet mentions him even here, even this early in the play. Hamlet himself will manipulate people's assumption that he's mad as the play goes on.