The Mystery has been Solved

Given an understanding of what Sigmund Freud considered to be the essential Oedipal feelings common to all men, and the effects of the repression used to keep these guilty fantasies at bay, Freudian critics then go on to address what they consider the heart of the matter in Hamlet; the reasons for Hamlet's seeming delay in killing Claudius. For them, Claudius represents, in flesh and blood, the embodiment of Hamlet's Oedipal urges. He has actually killed Hamlet's father and is sleeping with his mother.

Hamlet's second guilty wish had thus also been realized by his uncle, namely to procure the fulfilment of the first -- the possession of the mother -- by a personal deed, in fact by murder of the father.  - Jones. p.83.

Hamlet's hesitation in killing Claudius, according to Freud, has to do with his deeper association with him. Claudius serves as a flesh and blood expression of his own repressed childhood fantasies, and to kill him would be to murder a part of his own inner self already associated with self-loathing.

Hamlet is able to do anything -- except take vengeance on the man who did away with his father and took that father's place with his mother, the man who shows him the repressed wishes of his own childhood realized. Thus the loathing which should drive him on to revenge is replaced in him by self-reproaches, by scruples of conscience, which remind him that he himself is literally no better than the sinner whom he is to punish. Here I have translated into conscious terms what was bound to remain unconscious in Hamlet's mind....
The distaste for sexuality expressed by Hamlet in his conversation with Ophelia fits in very well with this.  - Sigmund Freud, The Interpretation of Dreams, tr. James Strachey, Avon, N.Y. 1965. p.299.

The "clincher" on Freud's solution to what he called "The Problem" has to do with not only Hamlet's delay in killing the king, but also with the actual murder of Claudius. The long-awaited event can only take place when Gertrude has died. Hamlet is then free to act because the cause of his repressed guilt has been eliminated, and he kills Claudius immediately.

In reality his uncle incorporates the deepest and most buried part of his own personality, so that he cannot kill him without also killing himself. This solution, one closely akin to what Freud has shown to be the motive of suicide in melancholia, is actually the one that Hamlet finally adopts... Only when he has made the final sacrifice and brought himself to the door of death is he free to fulfil his duty, to avenge his father, and to slay his other self -- his uncle.  - Ernest Jones, Hamlet and Oedipus, W.W.Norton, N.Y. 1976. p.88.

There are two moments in the play when he is nearest to murder, and it is noteworthy that in both the impulse has been dissociated from the unbearable idea of incest. The second is when he actually kills the King, when the Queen is already dead and lost to him for ever, so that his conscience is free of an ulterior motive for the murder.  - Jones. p.89.

It is interesting that Freud, in building his argument about Hamlet, puts not only the principle character on the couch, but also his author. He supports his position by citing (possibly eronious) facts from the little that we know of the life of Shakespeare himself.

I observe in a book on Shakespeare by Georg Brandes (1896) a statement that Hamlet was written immediately after the death of Shakespeare's father (in 1601), that is, under the immediate impact of his bereavement and, as we may well assume, while his childhood feelings about his father had been freshly revived. It is know, too, that Shakespeare's own son who died at an early age bore the name of 'Hamnet,' which is identical with 'Hamlet.'  - Sigmund Freud, The Interpretation of Dreams, tr. James Strachey, Avon, N.Y. 1965. p.299.

(There is, in fact, evidence to contradict Freud's assumption that Hamlet was written after the death of Shakespeare's father. That death was entered in the Parish Register of Stratford on September 8, 1601. The Stationers' Register, a book located in the guildhall of the Company of Stationers, the printers and publisher's organization of England, places early performances of Hamlet around 1600 to 1601. By this sequence of events, Hamlet either preceded Shakespeare's father's death or appeared so soon after it that it could not have been conceived and written after his demise.)