For a very readible treatment of Hamlet, check out Isaac Asimov’s Guide to Shakespeare. This book attempts to explain what is going on in each of the plays by providing some context for the societies on which the plays are based.
For example, it is currently popular to provide a Freudian explanation for Hamlet’s behavior. He seems to be extremely unhappy that his mother remaried, and so, in today’s culture, it is easy to conclude that he had unresolved sexual issues about her.
The Guide, by providing the cultural background for Denmark in the year 1050 or so, shows that Hamlet’s behavior is completly explicable without such modern interpretations. Of course, if, for whatever reason you want to insert a Freudian theme, you are free to do so. It just isn’t required by the text.
Basically, the concept of strict hereditary inheritance of a monarchy didn’t really get firmly established in Northern Europe until about the thirteenth century. Prior to that, the crown went to the member of the late king’s family who the nobles thought would be the most capable king.
So Hamlet is away at school (the university at Wittenburg wasn’t founded for another couple of centuries, but never mind) when his father dies, apparently of natural causes. Had he been at home, he presumably could have made a strong case to succeed his father.
He arrives home to find the question of succession already settled. The nobles have selected Claudius, due, probably, to effective politicking by Polonius (which explains why Hamlet isn’t real fond of him), supported by the sense of continuity provided by his marriage to Gertrude. By marrying Claudius, Gertrude has participated in disenfranching Hamlet.
Such things happened often enough in British history that Shakespeare’s audience would be quite familiar with these sorts of politics.
Also, Hamlet’s problem is not indecisiveness, but that he is constrained from taking direct action.
If he kills the king openly without cause, he will be condemned as a murderer and regicide, and will be unable to take the throne. Conversely, if Claudius openly murders Hamlet, he will likely lose the throne. Both parties are thus prevented from acting directly, and are forced instead to employ a series of increasingly complex strategies, which is what makes the play so facinating.