5. Regardless of who is interrogated (liar or not), to the question "Are you a liar or not?" the person will answer: "I'm not a liar!". Indeed, if he is not a liar, then he is telling the truth. If he is a liar, then he will say a lie about himself (that is, that he is not a liar).
So, Robinson was just checking the honesty of his companion: if the companion was a liar, then he would lie and tell Robinson that the answer was "I'm a liar!". Since the companion said that the answer was "I'm not a liar!", then the companion must be a truth-teller.