Hamlet learns from his father's ghost that his uncle, Claudius, murdered his father. Claudius is now married to Hamlet's mother. Hamlet has to decide if the ghost is really telling the truth. If so, Hamlet is honor-bound to avenge his father's death by killing Claudius. This situation depresses him.
Three indications of depression are seeing the world as an unpleasant place, showing sadness, and having thoughts of suicide. Hamlet shows all three.
Hamlet expresses his conviction that the world is rotten and corrupt in Act I when he says,
"How weary, stale, flat and unprofitable, Seem to me all the uses of this world! ...things rank and gross in nature / Possess it [the world]."
In Act II, he says "the air ... appears no other thing to me than a foul and pestilent congregation of vapours," a powerful way of saying "the world stinks." He doesn't even want to breathe the same air as the corrupt courtiers Rosencrantz and Guildenstern.
When his mother, Gertrude, notes that he looks sad, he responds that his looks don't begin to express the grief he feels inside. He calls "the fruitful river in the eye" [his tears] and his "dejected" face, "but the trappings and the suits of woe." In other words, while he is crying and he is sad, anyone can fake these feelings with false tears and sad face, but he, Hamlet, really feels sad within.
Finally, Hamlet also expresses thoughts of suicide. In Act I, he says:
Oh, 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!
In other words, he wishes he would melt to nothing or that God allowed people to commit suicide.
In Act III, Hamlet again wishes he could die. As he puts it:
To die, to sleep—
No more—and by a sleep to say we end
The heartache and the thousand natural shocks
That flesh is heir to—’tis a consummation
Devoutly to be wished!
To Hamlet, the world is dull, flat and corrupt. Hamlet is very sad and he is flirting with suicide: we can safely say he is depressed.