This isn't an either / or situation. I don't go do medical research online because I don't believe what my doctor tells me. Hell, in the case of my GP, he tells me to go online and look for stuff.

Why? Well just think about it and do the math. Let's start by talking about a GP / Family Doctor, not a specialist. A GP treats both kids and adults, and deals with, effectively, every possible condition a person could have - from ingrown toenails to cancer. There's just no way one person could be completely knowledgeable on all of the latest research and thinking on every one of those topics. A family doctor most likely optimizes for the common case, by being very knowledgeable about the really common / obvious stuff... which means the less common your condition, the less likely your doctor is to be really informed.

In a similar vein, think about how many patients your GP has, and how many different diseases, syndromes and conditions she has to think about / deal with, all the time. Let's say you see the doctor once every 3 months... do you think she is going to remember every detail that you told her last time, without mentally conflating something with something influenced by another patient. The book How Doctors Think talks a lot about how cognitive biases like "availability bias" affect doctors.

Given all that, you'd be nuts to go in with a mindset that "the doctor is always totally informed, and always right". And even if we were talking about a specialist instead of a GP, the same basic reasoning applies, just with slightly different details.

What triggers you to believe whatever info you receive online, vs. what your doctor told you to do?

Again, it isn't that I believe what I read online more than what my doctor says. It's about knowing that doctors don't know everything, are subject to biases, and can't be 100% totally attentive to any one patient, because of conflicting demands. So I go online, read stuff, and if I find something interesting, I go back and talk to my doctor(s) about it. Sometime that leads one of them to say "You know what, let me do some more reading on that and get back to you" or whatever. Or sometimes it leads to "I really hadn't thought about that, but that's not a bad idea".

Case in point: I had a heart-attack, so I now see a cardiologist. He prescribed me the full array of modern prescription drugs that "the canon" tells a cardiologist to give a patient post-MI. But I did some reading on various dietary supplements that are (purportedly) beneficial, and went to him and said "Hey doc, let me run through this list of stuff with you and see what you think." On almost all of them his response was "as far as I know, there isn't enough evidence to say one way or the other. Feel free to take it, but I can't promise it will help you, or that it won't hurt you." OK, that's expected. But when I mentioned fish-oil, his face kinda lit up and he goes "Oooh, yeah, you should probably be taking that". And so it's now officially on my chart as something I am supposed to take, right alongside my other meds. Would he have thought of that if I hadn't mentioned it? Maybe, eventually. Maybe not. But I'm glad we talked about it, because the more I read, the more convinced I am that fish-oil has some very strong benefits. That fact that a cardiologist agrees that I should be taking it lends to my confidence that it is beneficial.

Another anecdote for you: I take a drug called Metoprolol, after having the MI. From what I can tell, most cardiologists (mine included) generally plan to put any patient who has an MI on that drug (or a similar one) for the rest of their lives. Now I could just accept that and leave it be, but here's the thing. Because I went online and read up on it, I know that it hurts your cardiovascular performance (in terms of running, biking, etc.) by a significant margin (10% or more). I am a competitive bicycle racer, so that's bad. I also found out that there's some really recent research showing that there's no mortality benefit to treating post-MI patients with Metoprolol more than one year after their MI. So all of this lead to me talking to my cardiologist and saying "can we talk about dropping the Metoprolol after a year". Now it hasn't been a year yet, and we haven't made a decision yet, but the point is, I have to live my life, and I want to have the most informed conversations I can with the doctors, based on all of the different parameters in play. And if I didn't do things like going online and reading up on drugs, etc., I'd be flying blind.