“Are you a liar?” does not work because liar would say no and the true cannibal will also say no so we cannot find who is telling truth and who is lying.
The question If i were to ask whether you are a liar,would you answer yes would work here double negation means
for the question are you a liar the original answer of the liar cannibal be yes name it p first it would answer no so this will be first negation of p and for second question would you answer yes it would say no another negation of p so both negations get canceled and it would be an yes