Even before Hamlet's meeting with his father's ghost, he knows that his uncle suspects him of plotting a coup against him. Claudius would naturally think that way because he thinks that way himself. People always judge others by themselves. When Macbeth is plotting against Duncan, he says in a soliloquy:
But in these cases
We still have judgment here, that we but teach
Bloody instructions, which, being taught, return
To plague th' inventor. This even-handed justice
Commends th' ingredience of our poisoned chalice
To our own lips. (1.7)
Much of Shakespeare's Hamlet is about Claudius spying on his stepson and getting others to spy on him. He uses Polonius, Rosencrantz, Guildenstern, Gertrude, and even Ophelia to try to get inside Hamlet's mind and find out if he might be planning to organize a coup. Like Macbeth, his guilt makes him paranoid. His excessive drinking is due to his guilt and fear.
Once Hamlet learns that Claudius killed his father and usurped the throne, he knows that it will be difficult to hide his true thoughts from the cunning king. Before his interview with the Ghost, Hamlet had no thoughts of violence against his uncle. He seemed content to wait his turn to become king. He was not particularly ambitious. But now that he knows the terrible truth about Claudius he feels it will be impossible for him to hide his hatred and his sacred obligation to murder him. This is evidently why he decides to pretend to be mad. It will make it impossible for Claudius or any of his spies to penetrate his mask of madness.
Polonius, Ophelia, Rosencrantz, Guildenstern, and Gertrude may all be taken in by Hamlet's "antic disposition" and believe him to be a harmless lunatic; but Claudius remains suspicious. He tells Polonius, in a marvelous metaphor:
There's something in his soul,
O'er which his melancholy sits on brood,
And I do doubt the hatch and the disclose
Will be some danger . . .
The entire play may be read as a duel of wits between Claudius the protagonist and Hamlet the antagonist. Hamlet is never really mad. He is in a perilous situation and feels compelled to pretend madness in order to remain free to work out his revenge against an extremely crafty, powerful, unscrupulous, and dangerous opponent.
The idea of Hamlet's Сantic disposition being anything but a reality is without merit. Hamlet simply felt his sanity slipping away, and cleverly found an outlet for his "mad" behavior. He had no choice but to tell himself that he was feigning his behavior, because it helped him to avoid regarding his wild and whirling emotions as authentic.