If the main character has a few strong character traits and the protagonist presents opposite character traits just as strongly, it's likely you have a foil.