This concept is rather strong in people with loud mouths. Those most focal are often those who complain and worry the most. So, while it is a legitamate concern, that concern may not be as strong as it might seem.
Fields at Risk. Everyone gets worked up about "people stealing our jobs." At least they wont work at rates of the people of the future ("They took our jobs!"). The thing is that no one can really replace a doctor. People site similar rates and outcomes when it comes to certain fields, and say that "nurses are just as good as doctors." But you have to look at what that means. Nurses are just as good as doctors when it comes to specific tasks. Doing ABIs? Equal. Filling out an H+P Form? Equal. Following an algorythm for an ER complaint? Equal. Sewing a patient closed after a heart transplant? Equal.
It is the physician who performs better when it comes to complex tasks like diagnosing a chief complaint ("Shortness of Breath" to "Idiopathic Pulmonary Fibrosis" vs "COPD exacerbation). Further, when the routine stuff that "nurses do as well as doctors" becomes not routine, complicated, or somehow different, it is the vast education and exposure of a physician that allows them to adapt.
When I was a paramedic I took a patient to a doctor's office visit (god I hated commercial EMS) to have a peg tube pulled. A PA working for the GI doc tugged on it. Didn't work. She left to get the doctor. The doctor came in, took one look, and yanked it out. Something as simple as a "stuck" peg tube was too much for the PA (too different from her usual), and required the doctor to come by. So while that doctor's office became more efficient, more patients were seen, more patients were cared for, but she could not have functioned without a doctor. The same story can be true of Anesthesia with difficult cases, APRNs in a primary care clinic, whatever the story may be.
A different mindset. Choose something that isnt routine nothingness. Pick things like internal medicine and subspecialities, surgery, and OB.
But if you must pick something where you do good in people's everyday life (like outpatient anything, peds, family) think about how you run it. It's not them stealing our jobs, it is using other health professionals to advance our own practice.
Do you LIKE discharging patients, scheduling appointments, and filling out paperwork? I dont. Its something I MUST do for my job. But what if there were another health professional (PA, NP) who was just as good as I was at filling out paperwork, scheduling appointments, and discharging patients? Would I let that person do it? Hell yeah I would. Who makes the decisions on diagnosis? Who makes the decisions on tests ordered or medications started? Yeah, me. I wish I was going to a residency where the busy work was covered by some one else. I chose a residency with many more perks than that, but how awesome would that be?
Bottom Line. You should not pick a specialty on who might steal it later. The thing is that you are always going to be a manager, a leader, and more sophisticated in whatever field you choose. Be a manager, a leader, and use other health professionals to advance your practice, your patient's care, and make the world a better place. Does that mean a pay cut to what doctors are used to? Probably. But who cares? Patients will benefit. Society will benefit.