Hamlet's alienation is personified by his opening line:
It is the fact that his first line is an aside that so perfectly encapsulates his alienation from a society that he should be the center of. He does not speak the line to his Uncle, or even the Court, but rather as an inward comment aimed at breaking the third wall of the stage for the audience. He is alienated from his world, and thus able to be fully involved within it. He can no more act to revenge his father than he can feign happiness at this mother and uncle's wedding.
As the play continues Hamlet's alienation deepens and starts to influence many of those around him. When he decides to put "an antic disposition on" (I.3) the question arises for the rest of the play whether he is playing at being mad, genuinely mad, or perhaps both. Here is the second part of the inaction - madness that removes a person from the common spheres of reality. But Hamlet's madness is in fact closer to the reality and genuine feeling than those supposedly sane people around him.
Thus when he is chided for carrying on with his mourning beyond that which is seen as convenient or seemly, he answers, "I have that within which passeth show." (Hamlet, I.2) Others show their feelings on the outside, they are merely masks of feeling while Hamlet genuinely feels on the inside. The fact that he cannot show what he feels properly, or more importantly, act upon what he feels brings further alienation. When the actor cries over the death of his imaginary lover Hamlet is disgusted with himself, "what's Hecuba to him or him to Hecuba" (II.2). Nothing is the silent reply, but the actor can show more emotion (and action) than Hamlet can when his father has been genuinely murdered.
Perhaps the deepest alienation that anyone can feel is the wish to leave the world permanently through suicide. It is an even deeper alienation when that individual is young, rich and the heir to a throne. Hamlet's famous "to be or not to be" speech is an example of such alienation and, true to the form of the amoral world that Shakespeare has drawn in Hamlet he does not decide not to commit suicide for any ethical reasons, but rather for the practical fears of what may come in death. "What dreams may come"" he wonders in a frightened manner. Indeed.
When Hamlet does act it is often through a sense of irrationality than planning. Thus the killing of Polonius occurs because he is acting out the role of being a madman rather than actually feeling angry at him or wanting to get rid of him. Perhaps the greatest example of his inaction is when he has finds his Uncle kneeling in prayer, completely vulnerable to any kind of attack. As Hamlet says ""now I might do it pat, now he is praying, and now I'll do it . . . " (III.3) but then goes on to decide that in fact he should kill him when he is not close to Heaven:
Then trip him, that his heels may kick at heaven
And that his soul may be as damnd and black
As hell, whereto it goes. My mother stays;
This physic but prolongs thy sickly days.
Hamlet decides that he should kill his Uncle when he is drinking, or gambling, or maybe in bed with his wife (Hamlet's mother). This is the ultimate example