My son is currently 6 months old, but not long after I had him I needed a root canal. If you have an infection they will put you on antibiotics before they start the root canal treatments. Because I was nursing they started with a mild form of antibiotics (I think it was amoxicillan) that would cause no interference with the breastfeeding. However the antibiotic wasn't working. Eventually they put me on another more intrusive antibiotic (the name escapes me). My pediatrician said it was ok to still breastfeed but that the baby may suffer from diarrhea as a result. So I did take him off and did formula for a few days. But he didn't seem to take as well to formula and even choked on it once. So I went back to breastfeeding. Honestly his poo was worse on the Enfamil than it was on the tainted breastmilk.
I share that to say that you do want to consult with your pediatrician but unless you have to, you may want to stay consistent with the breastmilk if at all possible. The shots you receive to deaden your gums are safe, it's just those antibiotics that may cause some diarrhea. And of course you know to stick to your ibuprofen or tylenol. They may prescribe some with codeine if your pain is severe. It's ok for the baby but it will make you very very sleepy so be careful with those.
I hope this helps. I couldn't see the other answers so I pray mine wasn't redundant.