Jung, in his work on archetypes, identified the hero as a very common archetype in stories that basically vanquishes the various forces of evil. Jung argued that he represents the ego and is often very stupid as they lack self-knowledge and do not understand the collective unconscious. In addition, the hero is often trying to rescue the maiden and is guided by the wise old man who moves the hero on into knowledge of the collective unconscious.
If we think of Amir, this becomes very problematic, as he is definitely not your traditional Jungian hero. He has no maiden to fight for really, and he certainly does not engage in trying to defeat the forces of evil, as his abandonment of Hassan clearly shows. However, we definitely can identify Rahim Khan and to a certain extent Baba as representing the wise old man who challenge Amir and try and move him on into greater self-knowledge, and he does oppose evil towards the end of the novel as a result of this.
Hamlet again seems to not fit the mould. He lacks a wise old man, and is not necessarily trying to battle to save Ophelia. In fact, although he does oppose evil, he hardly does this in an open, direct way, and his action can be more characterised by procrastination than anything else. He, too, however, does move towards greater knowledge during the play, and in Act V, his speech to Horatio before the duel shows how he has developed and left behind his various doubts and worries.