This is famously called by George Boolos the "Hardest logic puzzle ever" (1996).
He, that, as far as I know, was the first to present and solve it, states the puzzle as follows:
Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which.
Some hints:
Since either A, B or C is the True, False and Random, we have $3!=6$ possible cases.
Now consider those three questions:
- Is A the Random or B is the False? ($Q_1$)
- Is B the Random or C is the False? ($Q_2$)
- Is C the Random or A is the False? ($Q_3$)
You should ask them to no matter who, in the structure:
If I asked you Q, would you answer me yes?
Note that the above indirect sentence contains two questions one inside another. The result is that even if the False lies in the innermost question, he will have to lie about lying in the out-most question and this amounts to the cancelling of the negations.
In a normal scenario, that is, where the foreign language problem is not put, then those three questions are enough to find out the identity of A, B, C.
To see this, simply construct a truth table of $2^3=8$ lines, corresponding to the possible combinations of answer to those questions:
$$\begin{array} {|c|}
\hline
Q_1 & Q_2 & Q_3 & Interpretation\\ \hline
\color{red}{1} & \color{red}{1} & \color{red}{1} & --\\ \hline
1 & 1 & 0 & \text{A: Random, B: True, C: False} \\ \hline
1 & 0 & 1 & \text{A: True, B: False, C: Random}\\ \hline
1 & 0 & 0 & \text{A: Random, B: False, C: True}\\ \hline
0 & 1 & 1 & \text{A: False, B: Random, C: True}\\ \hline
0 & 1 & 0 & \text{A: True, B: Random, C: False}\\ \hline
0 & 0 & 1 & \text{A: False, B: True, C: Random}\\ \hline
\color{red}{0} & \color{red}{0} & \color{red}{0} & -- \\ \hline
\end{array}$$
Where:
$$Q_1 \equiv Random(A) \vee False(B)$$
$$Q_2 \equiv Random(B) \vee False(C)$$
$$Q_3 \equiv Random(C) \vee False(A)$$
Indeed, since there is one and only one True, False and Random, it is easy to see that the first and last lines of the table are impossible (show it!). Hence, of of it amounts to, again, 6 possible interpretations, where in every case we can find the True, False and Random's identity.
The above solution assumes we know the language of the True, False and Random.
Now, in its own language variation, we can try to overcome the fact we don't know what ja or da means by considering the following question, as firstly observed by Roberts (2001):
If I asked you Q, would you answer me ja?
In fact, this answer to this question will come out as ja if the truthful answer to Q is yes, and as da if the truthful answer to Q is no. Now, what about applying this reasoning with the above solution?
We can analyze this question using boolean algebra. Let $p$ represent whether the native is type A (true) or type B (false), and let $q$ represent whether Thomas is sane (true) or insane (false).
The statement "Can the native ask the question 'Is Thomas insane?'" is logically equivalent to $p\oplus q$, where $\oplus$ is XOR or exclusive or.
The statement "Does Thomas believe that the native can ask the question 'Is Thomas insane?'" is logically equivalent to $(p\oplus q)\Leftrightarrow q$, which is equivalent to $\neg p$. Here, $\Leftrightarrow$ represents "if and only if".
The statement "Can the native ask 'Do you believe I am the type who could ask you whether you are insane?'" is logically equivalent to $\neg p\Leftrightarrow p$, which is always false.
Best Answer
If the question is should you come with $C$ or not then the answer is yes, you should. Just split into cases.
Assume $A$ is telling the truth. Then you know $B$ is lying, because if he was telling the truth then you would get that $A$ really told you only $1$ of them is telling the truth (which you assumed is true) which is a contradiction to that both $A$ and $B$ are telling the truth. So $B$ is lying and $A$ actually told you more than $1$ of them is telling the truth (he couldn't say none of them is telling the truth because he is telling the truth himself). So in that case $C$ is telling the truth and he is not a cannibal.
Now assume $A$ is lying and $B$ is telling the truth. We'll show this case is not even possible. In that case $A$ really told you only $1$ is telling the truth, but this is a lie. As you assumed that $B$ is telling the truth then you get that more than $1$ of them is telling the truth. So $C$ must be telling the truth. But then his words that $B$ is lying are the truth which is a contradiction to that $B$ is telling the truth. So this case isn't possible.
Finally assume that both $A$ and $B$ are lying. If you assume $C$ is lying then his words that "$B$ is lying" are a lie and $B$ is actually telling the truth. Once again a contradiction. So again $C$ is telling the truth and is not a cannibal.
So anyway, we can conclude that $B$ is always lying and $C$ is always telling the truth.