Answer:
In Act 1, Scene 5, Hamlet has just encountered the ghost of his father and found out his father has been murdered by Claudius.
As ghost disappears, Marcellus and Horatio arrive, while Hamlet is still extremely shaken. When the ghost reappears, Hamlet informs them he will follow it. In line 88, Marcellus tries to convince Hamlet not to do it, and both him and Horatio attempt to hold Hamlet back, but Hamlet does not listen and goes after the ghost. Horatio realizes that Hamlet is going crazy after everything that happened to him: 'He waxes desperate with imagination.'