Chapter XXXI is pivotal to Mark Twain's satire of a society that believed in slavery. When Pip learns that the duke has sold Jim for forty dollars, he is disgusted with the two con men:
After all this long journey, and after all we'd done for them scoundrels, here ws it all come to nothing, everything all busted up and ruined, because they could have the heart to serve JIm such a trick as that and make him a slave again all his life, and amongst strangers, too, for forty dirty dollars.
So, he decides to have no more to do with the duke and the king. Then, he feels that he should write to Tom Sawyer to inform Miss Watson where Jim is. Then, he figures that she will sell Jim for having been ungrateful, and then people would talk about him for having helped a slave get his freedom.
That was my fix exactly. The more I studied about this, the more my conscience went to grinding me, and the more wicked and low-down and ornery I got to feeling....here was the plain hand of Providence slapping me in the face and letting me know my wickedness was being watched all all the time from up there in heaven whilst I was stealing a poor old woman's n--- that hadn't ever done me no harm....
Clearly, Huck's moral reckoning is skewered by the society in which he lives and Twain's satire is obvious when Huck recalls how loving Jim has been to him and how cried when he thought Huck was dead. So, he decides that he will not turn Jim in, and he will just "go to hell" if necessary.