A mammogram is an X-ray of the breast used to detect breast cancer. Women should begin having mammograms at age 40 and continue every one to two years. Those with a family history of breast cancer or other risk factors may need to start earlier and have more frequent screenings.