My original answer assumed that there was no penalty for guessing incorrectly. This answer assumes that you are playing with the rule that incorrect guesses cause a game loss. My original answer is provided below this one
Never guess, unless a player has only a single character left
If your opponent guesses, then your odds of winning are 50% if they have two characters left or higher if they have more. If you guess, your odds are 50% if you have two characters left, or lower if you have more. Therefore, there is never any benefit to guessing - the odds are always equal to or better if your opponent guesses. This only changes if your opponent have a single character left. At that point the odds of losing jump to 100%, and any odds are better than that, so guess. (Also, if you only have 1 character left you should obviously guess as well)
Guess. Always guess when there are three or fewer characters left
Any question you ask is guaranteed to divide the remaining characters into a group of one and a group of two.
Guessing also divides the characters into a group of one and a group of two.
Literally the only difference is that if the character is in the group of one and you ask then you need to take an additional turn to guess, whereas if you guess and the character is in the group of one then you've already won.
Your error is in assuming that asking a question has a 50% chance of putting the character in the group of one. It's actually 1/3, same as when you guess.