During your medical program, you will get a chance for rotations where you train in each area of medicine. Its gives you first hand experience to select what part of medicine really resonates with you. Some people like the fast pace of ER medicine while some like the slower pace of working with kids. Surgery is the longest specialty, its a 5 year residency program and as expected they make the most money.
Family Medicine is one specialty where you practice all areas of medicine. You will not however be a specialist in any of the fields. You'll refer most cases to the specialist doctors.