Hamlet has spent the entire play worrying about his actions and doing the right thing at the right time. He has alternately been full of passion to fulfill the demand of the ghost and felt sorry for himself for having the command upon him. It is ironic then that in Act 5, he comes to a very freeing realization: there is only so much he can control and only so much he can do. He tells Horatio that there is a "divinity that shapes our ends rough hew them how we will" and that "the readiness is all." He allows himself to live in the moment and just do what he can at that time. He recognizes that there is an element of fate in everything we do -- we have some control (can "rough hew") some elements of our lives, but that ultimately fate will control the outcome. It is a very freeing idea! Once he is presented with the prospect of the sword fight he realizes that this could turn out poorly, but that all he can do is be as ready as he can for whatever happens. He isn't giving up, he is merely accepting that a lot of what happens in life can only be reacted to, not controlled.