Hamlet is essentially a very unmotivated person. He is apathetic, and prefers to think rather than to act. However, the thing that drives his resolve (to kill Claudius, which becomes his goal in the play) is i) the resentment that his mother got over his father so fast and married his uncle, and ii) that his father's ghost appeared to him. It's not exactly certain what relationship Hamlet had with his father, but Shakespeare makes it seem as though perhaps that was one relationship that Hamlet was actually committed. The appearance of his father's ghost was the thing that motivated Hamlet early on in 'Hamlet'.