I'm guessing that you realize that the entire book is written in dialect--the exact way
Huck, Tom and all the locals would speak.
As for the notorious "N-word", even Jim, the slave, uses it, because it is the only word
he has ever heard to describe people like himself. In his innocence and ignorance
(he is intelligent--ignorant only because it was illegal to educate slaves), he does not, cannot, realize that the "N-word" is a slur. I believe that Twain used this
for shock value.
Huck Finn is about as low on the white totem pole as anyone could be,
yet initially thinks of Jim (and all slaves) as less than human, he is forced to reconsider his beliefs in the course of their travels on the Mississippi.
That is the point if the book.
Was Twain sexist? Hardly. All of his books were carefully read in manuscript by his best editor--his wife Livy.
"Huckleberry Finn" is written from the viewpoint of a prepubescent boy in
19th century America.