In Mark Twain's The Adventures of Huckleberry Finn, Jim represents different things to Huck that make him a father-figure. Jim loves Huck and forgives him when he his less than kind to him, and Jim also protects Huck.
In Chapter Nine, Jim protects Huck when they find the floating house. There is a dead man on board, and we learn later that Jim makes sure that Huck never sees that it is his father's body.
"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."
I didn't look at all. Jim throwed some old rags over him, but he needn't done it; I didn't want to see him.
The reader again sees the depth of Jim's love for Huck in Chapter 15 when Jim loses Huck in the fog on the river. When Jim realizes Huck is not lost, he says:
Goodness gracious, is dat you, Huck? En you ain' dead—you ain' drownded—you's back agin? It's too good for true, honey, it's too good for true. Lemme look at you chile, lemme feel o' you. No, you ain' dead! you's back ag'in, 'live en soun', jis de same ole Huck—de same ole Huck, thanks to goodness!
Huck pretends as if he never left Jim in order to play a trick on his companion. Here Jim also acts like a father when he realizes what Huck as done, by appealing to Huck's conscience—encouraging Huck to be kinder—and scolding him for causing worry and embarrassment to a good friend:
But when [Jim] did get the thing straightened around he looked at me steady without ever smiling, and says:
What do dey stan' for? I'se gwyne to tell you. When I got all wore out wid work, en wid de callin' for you, en went to sleep, my heart wuz mos' broke bekase you wuz los', en I didn' k'yer no' mo' what become er me en de raf'. En when I wake up en fine you back ag'in, all safe en soun', de tears come, en I could 'a' got down on my knees en kiss yo' foot, I's so thankful. En all you wuz thinkin' 'bout wuz how you could make a fool uv ole Jim wid a lie.
This lesson should not need to have been voiced by Jim as Huck knows what it is like to have a terrible parent, as seen in the way Pap treats Huck—kidnapping and beating him before Huck stages his death and runs away.
Jim's concern and love for Huck allow the youngster to eventually see Jim as not a runaway black slave, but as a decent man and dear friend. Huck knows society does not see Jim in the same way, and he suffers pangs of guilt. Ultimately, however, Huck realizes he loves Jim more than he cares about society, and figures (ironically) if loving Jim means he is going to hell, so be it. As the eNotes character analysis states, Jim is...
...the only genuine father figure Huck has, teaching him the ways of the world and sheltering him from danger...