Was Mathis a traitor? I know that in Quantum of Solace Mathis was cleared of his innocence. However I believe that his character was written as a villain in Casino Royale. Why would Le Chiffre say that he was his “friend” if he wasn’t and why would Le Chiffre kidnap Vesper if she was working with Lechiffre and Quantum?
No, Mathis was loyal MI6.
Before Vesper disappears, she's having dinner with Bond. Their entire conversation is Vesper manipulating Bond so that he'll come after her.
She knows what's coming. She knows Le Chiffre will capture Bond. She knows that Bond will be suspicious.
To be sure Bond doesn't suspect her, she needs a fall guy. She chooses Mathis.
VESPER: Mathis needs me.
BOND: Good night.
Later, when Le Chiffre claims that Mathis is a double agent, he's simply throwing Bond off track, so he'll continue to trust Vesper. He even pretends to be torturing her.
LE CHIFFRE: Miss Lynd will give me the account number, if she hasn't already. So all I need from you is the password.