How does King Hamlet's death affect Hamlet as a character and his actions? How does this affect his relationships and behavior?
The death of King Hamlet affects his son in lots of different ways. For one thing, it makes him broody and introspective. It also makes him intensely suspicious. He suspects that Claudius has something to do with his father's death, but it's not until the Ghost appears to him on Elsinore's battlements that he has confirmation of this. The Ghost's appearance is crucial for Hamlet's subsequent character development as well as the dramatic development of the play itself. This Renaissance Christian prince is now forced to go against his values and seek revenge for his father's murder. But Hamlet, being Hamlet, will still do things his own way. He won't just pick up a sword and go off to kill Claudius; he's going to go about the business of revenge in a much more subtle way. That's why he pretends to be mad, putting his "antic disposition on"; it's also why he stages The Murder of Gonzago to smoke out Claudius and watch him squirm.
Hamlet's personal relationships are completely changed in the wake of his father's death. Those around him never quite know where they stand. As part of his mad act, Hamlet viciously chews out Ophelia, leaving her utterly distraught; he knowingly sends his old school friends Rosencrantz and Guildenstern to their deaths in order to save his own skin; and above all, his relations with his own mother, Gertrude, break down completely. Thanks to the Ghost's appearance, he's come to see his mother as lying with Claudius in an incestuous bed of treachery, shamelessly betraying the memory of his late father.
King Hamlet's death, especially after he appears to Hamlet as a ghost and tells him he was murdered by Claudius, weighs heavily on Hamlet, leading him into a spiral of depression in which he contemplates suicide. As Hamlet puts it
O, that this too too sullied flesh would melt,
Thaw and resolve itself into a dew,
Or that the Everlasting had not fix'd
His canon 'gainst self-slaughter!
Much has been written about why Hamlet is so depressed: is it because, in the Freudian/Oedipal reading, he is gripped with guilt that he unconsciously wanted to do just what Claudius has done: kill his father and marry his mother? Or is his grief over his father's death simply magnified into depression because of his inability to act? Or is he, as Rene Girard contends, caught between an honor code that insists on revenge killing and a Christian code of forgiveness?
Whatever the reason, throughout the play, Hamlet behaves erratically and expresses his anguish in soliloquies, displaying his groping for answers and understanding. His depression and the questions it raises about the meaning of life in a corrupt world affect his relationships as he pushes away Ophelia, whom he loves, and becomes alienated from his mother, his uncle and most of the courtiers that surround him. His behavior becomes so erratic that it calls into question his sanity.
The death of King Hamlet is the catalyst for everything that happens in Hamlet: Without his death, there would arguably be no play.
Before the death of his father, Hamlet seems to have been a relatively normal prince. He was attending school abroad, where he had friends in Rosencrantz and Guildenstern, and preparing for his ascension to the throne. He was even seeing Ophelia, the daughter of his father's trusted adviser, Polonius. However, the death of his father and the subsequent appearance of his father's ghost, which claims that it was Hamlet's uncle Claudius who killed him, makes Hamlet forget all of that. Instead, Hamlet's single interest in life becomes exacting revenge against his uncle and, collaterally, against his mother.
However, simply put, Hamlet is terrible at revenge. He drags his feet, squanders opportunities, and is ridden with self-doubt through most of the play. This tears his psyche so much that he wonders if it's really worth it, or if he should just kill himself, instead. He spurns Ophelia, betrays Rosencrantz and Guildenstern, and erratically swings from brooding and doing nothing, to acting rashly and impulsively towards his goal of revenge.