Doyle and Shakespeare both use eccentric but brilliant characters to represent the foibles of human nature in Hamlet and the Best of Sherlock Holmes through their egos.
Although there do not seem to be many similarities between Sherlock Holmes and Hamlet at first glance, both are men who did not fit society’s mold. In each case, they were brilliant, eccentric, and got results by being some rude, antisocial, and using other people to get what they needed.
Hamlet had a mystery to solve, in his own way. His father was murdered. His detective strategies were unconventional (including using his father’s ghost as the main witness), and his method of bringing the culprit to justice was rather messy. He ended up killing not just his suspect, but most everyone else too—including himself.
Hamlet’s flaw is his ego. Hamlet’s ego and overelaborate planning require him to develop a ruse in which he pretends to be crazy.
I am but mad north-north-west. When the wind is
southerly I know a hawk from a handsaw. (Act 2, Scene 2)
This is too much. All he needs to do is just kill Claudius! He develops an overelaborate plan to catch the king and make him betray himself with the play. The problem is this plan relies on Claudius having a conscience. When Hamlet sees the king praying, he decides not to kill him, because he thinks he will send him to Heaven. He is again relying on him to have morals and actually be really praying and asking forgiveness.
Sherlock Holmes is also drowning in his own ego. The best example of this is when he faked his death in the waterfall incident with Moriarty. Holmes decided no man but him could take down Moriarty, and he had to go into hiding to take out his organization and not let Watson know.
But I could not rest, Watson, I could not sit quiet in my chair, if I thought that such a man as Professor Moriarty were walking the streets of London unchallenged.”
Holmes takes it upon himself, instead of forming a partnership. He does not trust Watson, because he wants Watson to grieve. He thinks that Watson would betray some sign of things if he did not really believe Watson was dead. This shows real hubris, and real cruelty, on Holmes’s part. He could have found another way to take Moriarty down, without betraying his friend. Holmes shows only an interest in himself.
Holmes and Hamlet are both very selfish. They each have enormous egos, and use people as they need to. Just as Hamlet used Ophelia as part of his plan to be mad, Holmes used Watson in his plan to fool people that he was dead.