John and Peter are twin brothers. One always tells the truth and the other always lies. What single yes-no question can you ask to either brother to figure out which one is which?
The question is: Would your brother say that you tell the truth?
The solution is to find a question that the two brothers would answer differently, and that difference would therefore identify the two from each other.
For this case, the lying brother would answer the above question “yes.” The truthful brother would answer the same question “no.”
Another possible question is: Are you twins?