It's horrible when you realise that someone you once called a friend was never really there for you at all. Fake friends always seem to be worse than someone who openly hates you, because when you trust someone and they throw it all back in your face, it hurts, and makes you feel betrayed.
It can also be difficult to deal with - if you're in a big group of friends especially, as you wouldn't want to break the whole group up, but at the same time, you being unhappy is not fair, and you shouldn't suffer in silence. Your other friends could even feel the same way, and just be scared to say anything, so confide in someone who you trust and who you know will understand! Don't tell someone who might spread it, as this could make matters worse, and make your frenemie be meaner towards you than before, and get loads of other people unnecessarily involved.
The best thing to do is to begin to distance yourself from this 'friend' - this means that you can keep the group together, but that you're not constantly feeling uncomfortable. Don't tell them any secrets, and stop doing activities outside of school with them, unless you are in a big group. Still be friendly towards them, but don't go out of your way. You'll notice that as you being to drift away from them, they'll start to leave you alone.
If your problem is that you've heard that they're talking about you behind your back, first make sure that it's true, and then confront them about it. It may turn out that the person that told you got confused, or even that they never said anything in the first place. Even if that's the case, it's always best to find out, as otherwise you'll always be wondering if it was true or not, which can make you insecure, depending on what they were apparently saying, but remember, NEVER ASSUME ANYTHING! If you're wrong, you could really upset the person who you're blaming, and unnecessarily ruin a friendship. Don't do anything you could regret later.
Remember that even if one of your friends turns out to be a frenemie, you still have all your other friends who love you and care about you; don't let one person get you down:)