This is an important theme in the play and the example below will illustrate how the theme plays into Hamlet's characterization as well as meaning of the play as a whole.
A clear example of warning comes in the beginning of the play when Hamlet is intent on following the ghost to a more remote location and Horatio expresses concern over this. He reminds Hamlet that the ghost may actually be a devil in disguise who intends harm and that the ghost may
tempt you toward the flood, my lord, / Or to the dreadful summit of the cliff / That beetles o'er his base into the sea / And there assume some other, horrible form / Which might deprive your sovereignty of reason / And draw you into madness.
Hamlet refuses to listen to reason and demands that his friend let him go to where the ghost wants him to be so that they may talk in private. This reveals that Hamlet is determined and brave. He has already told Horatio that he doesn't "set his life at pin's fee" so there is also a kind of recklessness in Hamlet's behavior here.