Under Title VII, as amended by the Pregnancy Discrimination Act (PDA), pregnancy discrimination is a form of unlawful sex discrimination. Harassment based on you being pregnant or breastfeeding is a form of unlawful harassment. Employers governed by federal civil rights law cannot treat you differently from other employees because you are pregnant. Most states have laws prohibiting pregnancy discrimination, too.
Title VII, as amended by the PDA, requires covered employers to treat pregnant workers the same way they treat other workers “similar in their ability or inability to work” when it comes to benefits like health coverage, disability benefits, or job modifications like “light duty” if necessary for a healthy pregnancy. You are legally entitled to work as long as you are willing and physically able.