Answer:
The ghost tells him that his uncle killed him to get his crown and his wife, and makes Hamlet swear to avenge his death. Hamlet decides to pretend to be insane to make sure the king doesn't suspect him. Ophelia, the daughter of king's advisor, Polonius, also rejects him, adding to his melancholy.
Explanation: