I think your LO is on a nursing strike which is common for babies. There could be many reasons like baby feeling unwell due to the erupting tooth, strong letdown, distraction etc. It should resolve in a few days. Can try to latch your baby more frequently, more skin to skin contact, cary your nursing position.
He may have outgrown BM and is ready for semi solid food...if he still wants formula then continue with slow progression to solid food...each child is different there is no blueprint to raising a child...