If you ask a liar a question the answer will be lie.
If you ask a liar what his answer will be, he will lie about his answer being a lie and he will say that his answer is the truth.
So if the path leads to ruins and you ask if the path leads to ruins he will lie and say "no". If you ask him if he will answer "yes" he will lie and answer.... "yes".
....
To get the truth out of a liar ask him "What would you say if I asked you..." the liar will lie about lying and give the true answer....[1]
[1](assuming the question was binary yes/no... otherwise he could give a second lie; the lie he *wouldn't give.)
====
Or you could parse it from the top down:
Q: ""if i were to ask you whether the right branch leads to the ruins would you answer yes?"" LIAR: "NO"
That's a lie. He would answer yes.
- "Does the right branch leads to the ruins" LIAR: "YES"
- That's a lie. The right branch does not lead to the ruins.
- Conclusion: The left branch lead to the ruins.
Q: ""if i were to ask you whether the right branch leads to the ruins would you answer yes?"" TRUTHTELLER: "NO"
That's the truth. He would answer no.
- "Does the right branch leads to the ruins" TRUTHTELLER : "NO"
- That's the truth. The right branch does not lead to the ruins.
- Conclusion: The left branch lead to the ruins.
Hence "NO" means left branch.
Q: ""if i were to ask you whether the right branch leads to the ruins would you answer yes?"" LIAR: "YES"
That's a lie. He would answer no.
- "Does the right branch leads to the ruins" LIAR: "NO"
- That's a lie. The right branch does lead to the ruins.
- Conclusion: The right branch lead to the ruins.
Q: ""if i were to ask you whether the right branch leads to the ruins would you answer yes?"" TRUTHTELLER: "YES"
That's the truth. He would answer yes.
- "Does the right branch leads to the ruins" TRUTHTELLER : "YES"
- That's the truth. The right branch does lead to the ruins.
- Conclusion: The right branch lead to the ruins.
Hence "YES" means right branch.