I would like to go to an academy, but after I would like to attend medical school. How would that work?
As was pointed out, there are numerous threads discussing this. Some key points to consider:
You say you would like to attend an academy. That is a 4-year way station enroute to obligated service as a warrior in some warfare specialty. If you attend an SA, you should be fully prepared to execute your obligated service in a warfare area, if you are unsuccessful in being selected for a med school billet.
Out of USNA, a handful (recent numbers seem to run 13-15) out of each class are approved to apply to medical school. This takes top-of-the-line performance, strong MCAT, and gaining acceptance at a US medical school, or USUHS (the joint military medical school). The years of obligated service substantially increase and don’t start ticking off until some point after training is done. You essentially commit to years of service. The Navy is paying for your training; you pay with years of your life.
You can go to USNA and then serve in a warfare specialty, and a few years down the road, if you are a top performer, you can apply to lateral transfer to the Medical Corps. That can happen if your warfare community can afford to lose you and if Navy medicine wants you. This can happen, but everything has to align perfectly.
You can attend an SA, do your required minimum 5 years of service in a warfare specialty, do the extra 36 months after that to qualify for full Post 9/11 GI Bill educational benefits, separate from service, and go to med school, subsequent training and a civilian career. You could even apply to come back in as a military doctor, even in another service.
The armed services get the majority of their healthcare providers directly from civilian colleges and professional degree schools. They then are directly commissioned into their staff corps. If in your heart your real goal is to serve in military medicine and not the warfare specialties, research the scholarship programs below:
www.med.navy.mil
Navy, Army and Air Force all offer some version of these, I believe. You can also apply to USUHS out of college, similar to any other med school. I believe the students are direct commissioned at the start of their med school years.
www.usuhs.edu