Well if you truly mean she is two faced, that is a deceitful quality associated with being fake. We all have different sides to ourselves that may come out differently depending on who we are with. I am very different in different settings. Some of it is merely etiquette (like at work, with family, with friends, in public versus private, etc) and that is healthy & natural & all people should have some level of this. It's using your internal filter in some cases (like not swearing at work or in front of kids for example, but swearing when with friends), in other cases it's literally just how your personality plays off different personalities. I am much funnier in general around certain people than others because they bring it out in me. Some people tell me I am hilarious. I would bet there are some people that have never thought of me as funny at all, as in a reserved setting, I can totally reign in my silly side.
You are not talking about the benign personality shifts all people have. You are describing someone who essentially is embarrassed to be associated with you in certain circumstances. It is also worth noting, that despite the fact that she is behaving in less than stellar ways, you too are somewhat displaying an unflattering characteristic, which is that you are contemplating putting up with her flaws because you want to be able to use her in return as needed. You do not say how much you enjoy her company when the others aren't around. You do not speak to the things you like about her as a person at all. You merely say that she treats you poorly in front of others, but is so smart it's useful to have her around when you have use for that. That really is the way you can accurately describe "using" a person.
It doesn't sound to me like the two of you really like each other all that well & you both may be guilty of using one another for your own reasons as it suits you. I don't think you are friends, as friends don't act like this. You may be acquaintances, but friendship is something based on mutual respect, admiration, support, possibly other things at times like shared interest/hobbies, similar sense of humor, etc. It is not about the kinds of things I see you describing here.
The good news is you do not have to decide whether to have someone totally in your life or totally out. You can maintain very loose causal acquaintances with some people, closer with others, and have some extremely close friends. What I think is most needed here is for you to actually be more objective & realize that if you were once actual friends, that has long since passed when you both started treating one another as less than that & whatever you will be going forward is up to you. If you want to be friends, act like friends & treat one another with dignity, kindness, respect, and so on. If you want to maintain a loose acquaintance where you can both perhaps benefit one another when needed, that is a fine way to define it too & likely more accurate to where you are. If her behavior truly troubles you, or if you find after analyzing that you are also not treating her totally respectably, then you can decide to fix it, or let it go. All of those things are viable options & ultimately up to you to decide what you feel is what you actually want to have happen.