Sir I'm pretty sure that Hamlet is reacting like that due to unrequited love for ophelia
Please im begging y'all to hear from the two ambassadors
Polonius, chief adviser to the new king, tells Claudius that Hamlet's madness is due to unrequited love for Ophelia
Claudius is not convinced and plots with Polonius to spy on Hamlet. Hamlet's childhood friends, Rosencrantz and Guildernstern, have been summoned to the castle by the king and queen to keep close watch on him.
After Rosencrantz & Guildenstern leave the royal presence, Polonius rushes in announcing that he has found the reason for hamlet's madness.