I know it's a little too early to be asking these questions but it would help me clear my mind.
1. Does the rotation you do in 4th year determine what specialty you want to match into?
You largely choose your own 4th year electives, with some broad restrictions (most 4th years have to do at least 2 subinternship rotations in surgery and/or medicine).
You choose the specialty you want to match into. If it is a "core" specialty (general surgery, internal medicine, family medicine, ob/gyn, psychiatry, neurology, pediatrics) you'll see it in 3rd year and maybe decide then. Other specialties you'll try out in 4th year, and if you like it and do well you'll perhaps apply in that specialty.
Some specialties you have to decide on very early, likely before 4th year starts (urology, ophthalmology) because they have a different application process that begins very early in 4th year. Some specialties expect you to take the same rotation 2-3 times in schools other than your own (neurosurgery, orthopedic surgery), otherwise known as "away rotations." Sometimes you'll do an away rotation in your specialty of interest just to get to know a particular program better and get your foot in the door.
It's all rather complicated, but your medical school will walk you through it.
2. Do you apply to a bunch of specialties with different acceptance rates to ensure you match into one even though you might not want to go there *(like applying broadly to med school)
Only for very competitive specialties with low match rates, like dermatology or plastic surgery, or if you're not a particularly attractive applicant for some reason. In the latter case, applicants will sometimes add a preliminary year (1 year of medicine or surgery) to the end of their match list so they have something to do next year if they don't match and have to apply again.
Some people truly can't decide between specialties and apply to two or more. I would not recommend this option as this effectively multiplies the (already considerable) effort of applying for residency.
3. Is getting a MD/PHD better for matching into surgical residencies than MD?
Getting an MD/PhD is always better for matching, no matter what you want to go into. Surgery programs across the country are adding 1-2 research years to their 5 year programs now, so don't believe that surgeons aren't interested in research. Granted, some specialties will put more weight on the PhD (e.g., radiation oncology), but it will always be seen as a plus. However, it is 3-5 years of your life and it is not necessary to have a PhD to match in any specialty, so this would be a poor reason to pursue a PhD.
4. Does the research you do in undergrad contribute anything directly to the residency you match into or should the research be recent?
If by "contribute anything directly to" you mean help you get in, then yes. Again, significant (i.e., published) research will always be a plus on your application. If it is directly applicable to the specialty you choose, then of course it will be more germane to your application and to your future career.