Baby diarrhea

OK mothers that breastfeed I breast feed my son and he is a month old but it gives him diarrhea so I stopped for a few days and his poop looked a little solid and wasn't diarrhea and I tried breastfeeding again but then the diarrhea came back why does my baby get diarrhea from my breast milk and should I stop and keep using formula