Hamlet’s story was centuries old at the time that Shakespeare wrote Hamlet, about 1599–1601.
Hamlet corresponds to the figure of Amleth, whose story is narrated in the Gesta Danorum, Saxo Grammaticus’s late 12th-century history of Denmark. But the character’s famous hesitation—his reluctance or unreadiness to avenge his father’s murder—is central and peculiar to Shakespeare’s conception of Hamlet.
Hamlet shares his wit with the audience (and a few favoured characters, such as Horatio), who thus are aware of his superiority over most other personages in the play. His first words are a punning aside to the audience, and his first reply to the king is a cryptic retort.
His sardonic witticisms are unforgettable (“The funeral baked meats / Did coldly furnish forth the marriage tables” and “More honoured in the breach than the observance”).
Hamlet is an actor in many parts of the play. The range of language in the roles he affects shows that his mimetic powers are considerable. He is skillful in putting on “an antic disposition” and gives a very funny performance in talking to Polonius. He condescends to talk the silly bawdry of Rosencrantz and Guildenstern. He quarrels with Laertes beside Ophelia’s grave in a display of verbosity that exceeds the modesty of nature in much the same way as does that of Laertes.