terrible for giving up bf??

So
My son is 2 weeks old and we've had trouble breastfeeding from the very beginning. Let me start off by saying that it has been extremely painful from the get go. Every time I breast fed my toes curled. I got advice from nurses and midwives and they thought it looked good., then my first week home I met with a lactation consultant and she quote said that everything was petfect. Then a few days after that I fall very ill and come to find out I have mastitis, two days later both breasts are infected. Now I am exclusively pumping    And supplementing formula. My breasts aren't producing enough for supply and demand. It's been a nightmare of a week and now I'm pushing towards feeding him pure formula when I am healed. I need words of encouragement bc I just feel terrible. I feel like I am cheating my baby from an optimal healthier life. Can I get some opinions, should I stick w my gut and discontinue bf all together or perhaps give it one more try. Thx for reading.