How do I create a mysterious character? What personality traits and ways does he need to be mysterious? What attitudes must he have to be so?
You'd be surprised by how many people think you are mysterious if you:
do more listening than talking
Don't talk about yourself (not because you have something to hide or fear, you just don't think it's necessary, or you think you will bore people or you don't like being the center of attention)
Ignoring/not fully answering a question about your oddities
I've seen humble men, hippy men, moody men, or brooding men, called "mysterious." Mostly men actually....but as a woman, I've experienced this comment about me a lot.
A key trait for being mysterious is just simply not being open about yourself to others or your hobbies. Not in an antisocial or aggressively protective way. Being an introvert is also part of it as I have never seen a mysterious extrovert depicted.
This character isn't fitting into the standard world view of acceptableness either in looks, music taste, clothing choice, bragging about one's self or things, or profession, etc.. Still, it is not talked about, and when people do talk about, the character doesn't elaborate.
The paragon of this trait is the loner antisocial person who not only doesn't speak much on anything, but they fail at basic communication, which I think is a poor way to portray this trait. This character is guarded but noticeably so in a way that repels others rather then helps them by inviting them.
Empaths get this label by allowing others to come to them, listening, keeping or forgetting secrets confided to them. They speak little or not at all about themselves but not to push others away. They just don't believe they are interesting enough.
Do not tell the story from this character's point of view.
Do not have the character talk about his motives.
Avoid having characters who are familiar with the mysterious one and are at all willing to talk.
Know what the character is after, but this should be a relatively complex matter, or possibly even several purposes being pursued at the same time. This do not have to be major purposes, but the character's actions must not fit a simple pattern -- though this may be less important if you want to hide his motives for his actions, but not his purpose for it. For instance, if a man asks when another will be arriving, scouts out his path, buys a weapon that will allow him to make a ranged attack, and goes to a point from which he will be able to see the path, we know that his purpose is to kill the man, but not why he wants to.