Can you get pregnant while breast-feeding? Yes and no.
It is very unusual to get pregnant in the early months after having a baby when you're exclusively breast-feeding. Everything is working against normal fertility--the baby nursing frequently causes prolactin secretion, which inhibits normal menstruation, and due to the high intensity of the baby's needs, sexual activity is often not high on the list. But that is only when the infant is nursing frequently, as in every four hours or less.
Once a baby nurses less frequently or the baby sleeps through the night, all bets are off. Normal hormonal cycles can return, and so can ovulation. That is true even before a normal period occurs.
Obviously, women who don't breast-feed at all return to normal menstrual cycles soon. But they know that they don't have the "protection" of breast-feeding to prevent pregnancy.
Some women bleed for weeks after having a baby. The uterus needs time to return to normal, and it goes through a process of decreasing blood supply and cleaning. That process can wax and wane, and it can seem like a period returned during that time. Some women then start counting on the calendar until the next period is expected. That can be the flaw that leads to a very rapid next baby.
Unless you use some form of birth control, you could become pregnant even though you're breast-feeding. Depending on the rhythm method is a poor choice at this time because all the normal indicators will be off for a while. Cervical mucus may not return to normal until after a few cycles, and even menstruation may be nothing more than spotting while breast-feeding because prolactin suppresses estrogen.
The key here is to know that pregnancy can happen while breast-feeding once your infant nurses less often, especially when the baby goes more than four hours between feedings. While mothers often brag about how their baby sleeps through the night, they need to be careful if they don't want to be pregnant again quickly!