Formula feeding is recommended in various situations, including preterm infants, infants with metabolic disorders, and those with congenital abnormalities. It may also be necessary when the mother's milk supply is insufficient or when the mother is taking medications that are contraindicated during breastfeeding.