A hero is defined as a person noted for feats of courage or nobility of purpose. The character of Jim in Huckleberry Finn by Mark Twain certainly fits that description. He risked his life in order to free himself from slavery, and in doing so, helps Huck to realize that he has worth. Huck becomes aware of Jim's sense of love and humanity, his basic goodness, and his desire to help others. There are many illustrations of this phenomenon in Huckleberry Finn.
The reader first becomes aware of Jim's sense of love and humanity when Jim discovers Pap's corpse on the houseboat:
...But it didn't budge. So I hollered again, and then Jim says: "De man ain't asleep -- he's dead. You hold still-- I'll go en see. "He went, and bent down and looked, and says: 'It's a dead man. Yes, indeedy; naked, too. He's ben shot in de back.
I reck'n he's ben dead two er three days. Come in, Huck, but doan' look at his face -- it's too gashly.'
This is an example of how Jim is a humane and loving person because he does not allow Huck to see his dead father's face once he sees and understands the position in wehich he is placed. Later, Huck wishes to speak to Jim about the dead man, but Jim will not allow it since he does not want to reveal the truth about Pap to Huck. This is a second and more direct approach that is used in the story in order to show this same point.
Jim is also basically a good person. Although he is ignorant, he knows that it is a good thing for him to show Huck that he has worth so that Huck can think of him as an equal.