Throughout the story you notice that Jim and Huck's relationship change slowly throughout the story, and actually induces the climax of the story.
In the beginning of the story Huck is the same as he was in the prequel, The Adventures of Tom Sawyer, which was much more of a childrens book
(I've read Tom Sawyer, and reading The Adventures of Huckleberry Finn afterword about 6 years later seems almost like the book grew up with me, becoming more mature, and not so "sprinkled in sugar")
At first, Jim and Huck (after Huck's fake death) aren't very fond of eachother, but none the less, Jim is very friendly in all aspects. Huck sometimes takes advantage of Jim, and plays mean pranks on him. Jim reacts as "a white man would" and Huck realizes that these pranks he pulls on Jim are really hurting his feelings, and Huck feels like a bad person for such pranks.
About Mid-story, Huck and Jim are very good friends, Huck will "risk his hide" just to save Jim in serious situations, most, caused by the Royal Nonesuch (aka The King and The Duke who are con artists)
Huck feels that being good friends with Jim is going aganist his religion, brought up to him by The Widow, and more than once implys that he will "go to hell" for Jim because Jim has done nothing wrong to him, and Jim even said to Huck, that he is his only friend, and his best friend, because nobody has ever been so nice to him.
Around the end of the book, Tom Sawyer is reintroduced to Huck, and Huck becomes the follower he usually is around Tom. Tom regresses Huck and Jims relationship, and Jim almost becomes a prop in the background to Tom's master scheme, (which is really just to entertain himself) which has no meaning at all since Jim could easily be freed.
At the end of the book all is well and most of Huck's friends and relatives see that Jim really is a good person. Unfortunately Huck is off for more adventures with Tom and (as far as I know) they leave Jim behind.
This is how friendships can change someone. (In a way)