Respectively the protagonist and antagonist of the play, Mirabell and Fainall, are foils for each other. In Act 1, Scene 3, they begin to show themselves as opposite sides of the same coin:
FAINALL: For a passionate lover, methinks you are a man somewhat too discerning in the failings of your mistress.
MIRABELL: And for a discerning man, somewhat too passionate a lover; for I like her with all her faults; nay, like her for her faults.
Fainall at first looks like the nice guy in the conversation, because he defends Millamant against Mirabell's litany of complaints about her. Mirabell responds here that his focus on Millamant's faults does not make him any less in love with her. In fact, he even likes her for her faults. Although not clear yet, Fainall has a hidden motivation here. He is trying to steer Mirabell away from a marriage with Millamant because that will mean less money for him to inherit through his wife, Millamant's cousin. Fainall tells Mirabell that it sounds like Millamant is more trouble than she is worth to plant the seeds of doubt in his mind. Whereas Fainall uses the guise of friendliness to manipulate everyone into getting what he wants, and does his best to draw out people's bad qualities, Mirabell wears his heart on his sleeve and sees the best in everyone.
Mirabell and Fainall aren't entirely different from each other, though. Their wits are well-matched, as is suggested by the fact that they play cards together. They both spin out elaborate schemes, essentially to compete for the same fortune. Neither one of them is after the money, exactly. They diverge in their desires and codes of ethics. Fainall wants to seize Lady Wishfort's entire fortune because doing so will mean he has won over everyone else. The game for him is all about control. Humiliating, hurting, and tricking people on the way to winning is not a necessary evil for him, but rather part of the fun.
Mirabell, on the other hand, wants to marry Millamant because he loves her. Her dowry makes her a suitable match, but it is mostly beside the point. Notably, Mirabell is hands-off in his manipulative plot to get what he wants. Although not above tricking people, he has Waitwell and Foible do most of the actual lying and performance so that he does not have to do the dirty work himself. Congreve does not depict him as someone who maliciously uses others to carry out dastardly schemes. Rather, his reliance on Waitwell and Foible helps him remain the hero of the play. Mirabell "looks well," meaning both that he is exactly the good guy he seems and that he sees good in other people. Fainall, meanwhile, "feigns everything," constantly lying and assuming that everyone else is also a misanthrope.
In Act 4, Scene 15, Lady Wishfort receives a letter from Marwood that the audience knows will reveal "Sir Rowland" to be Waitwell in disguise. Lady Wishfort reveals herself to be a foil for Millamant:
Now with your permission Sir Rowland, I will peruse my letter. – I would open it in your presence, because I would not make you uneasy. If it should make you uneasy, I would burn it – speak, if it does – but you may see by the superscription it is like a woman’s hand.
At this point, Lady Wishfort desperately wants to marry "Sir Rowland." Unlike the audience or Waitwell and Foible, she has no idea what's in the letter. For all she knows, Sir Rowland might think it's from a rival suitor. To put him at ease, she points out that the handwriting looks like it's from a woman, not a man. She offers to open it in front of Sir Rowland because she wants to demonstrate her deference to her prospective husband.
This deference directly contrasts with Millamant's insistence on her independence in the famous "proviso scene" (Act 4, Scene 5), when Millamant and Mirabell discuss the hypothetical terms of their marriage. Especially for a woman in this time period, Millamant is adamant that she does not want to be a deferential wife. She wants to sleep in even after she is married because she likes sleeping in. She does not want to show public displays of affection with her husband (something Lady Wishfort is already doing with Sir Rowland). Most notably, she want to be allowed to have all the guests over that she pleases and to keep up correspondence with anyone she likes without risk of provoking her husband's jealousy. This may not seem like a lot to ask in a marriage today, but Lady Wishfort's concern about Sir Rowland's jealousy before they are even married demonstrates that Millamant has reason to be concerned about losing these small freedoms.
Many other characters in the play are also obvious foils for one another. Usually, names signal that characters are foils. For instance, Lady Wishfort wishes "fort," or strongly, for a suitor, whereas Millamant has "mille amants," or a thousand lovers. Lady Wishfort is more concerned about keeping a man's attention, whereas Millamant can be pickier. Millamant does not want to end up like Lady Wishfort, so desperate for a man's attention that she will sacrifice her entire identity and social life for the sake of his comfort.