When my kids were little, they used breastfeeding as a coping mechanism for teething. They would suck because they wanted comfort rather than to eat. It was tough to get them to stop doing it, but I finally got it to stop by using a few different methods.
Some things that help teething babies:
You can anesthetize” baby’s gums with a frozen/refrigerated teething ring, or rub ice cube on his gums (you can even make a game of it). Try to get baby to nurse. If he pulls off/screams again, repeat the ice-rub.
You could also put some crushed ice into a clean baby sock and tie off the top. Since it can “mold” around the gum, this is often helpful for painful teething. The fabric is easy and comfortable for baby to handle and babies like the texture of the fabric, too.
Freeze or refrigerate a wet washcloth for baby to chew on. You can also give them a Nissi & Jireh teether. These are pretty cool and they are freezable. They feature many different textures for baby to explore and come in two colors and a gorgeous package.
Moms of teething babies sometimes get sore nipples from baby’s gumming or “chewing” from discomfort (see above link on biting) or due to the increased saliva that comes with teething.