Concerning the meaning of the word translated "repent"
In the piel, "nacham" refers to comforting or consoling, but in the nifal, as it is in Job 42:6, it can also mean "repent" or "be sorry" (HALOT). And while "console" is also a possible meaning of the word in the nifal, "repent" makes more sense when juxtaposed with "dust and ashes".
Concerning possible translations of the verse
The literal translation of the verse, word for word, is "Therefore I reject/abhor and repent on dust and ashes." Though it is technically speaking possible to read the verse as if Job were repenting of the dust and ashes, this rendering of the preposition "al" is rare and poorly supported. But the context must make the final determination:
Job 42:5-8 “I have heard of You by the hearing of the ear,
But now my eye sees You.
Therefore I abhor myself,
And repent in dust and ashes.”
And so it was, after the LORD had spoken these words to Job, that the LORD said to Eliphaz the Temanite, “My wrath is aroused against you and your two friends, for you have not spoken of Me what is right, as My servant Job has.
Now therefore, take for yourselves seven bulls and seven rams, go to My servant Job, and offer up for yourselves a burnt offering; and My servant Job shall pray for you. For I will accept him, lest I deal with you according to your folly; because you have not spoken of Me what is right, as My servant Job has.”
Job is portrayed in a positive light, as one accepted by God. It is therefore not likely that Job was turning away from "the way of dust and ashes", since dust and ashes were symbols of his godly humility. This is made even less likely by the fact that Job's statement in v6 is motivated by what he says in v5 about having seen God.
The better translation is therefore "Therefore I reject/abhor [myself/my previous words], and I repent in dust and ashes." Otherwise, if Job did not repent, it is difficult to explain why God blesses and exalts him at the end of the book.