I've bought locally, at gunshows, and over the internet. It all depends on what I'm looking for and what's out there.
I've picked up two rifles from AIM Surplus, had 'em shipped to my local shop, and paid the transfer fee. All went well, and I was pleased. Within the last year I've bought an SKS from one local shop, a 1911 and a Kel-Tec from another, and a Mosin from another. They were all good deals and the shops I go to are more or less pretty good. I got a lot of my ammo and accessories from the gunshow, as there's usually the best deals. Sometimes I'll hit Tapco, CDNN, or Numrich online for harder to find items or things I want I can't find locally and when I don't want to wait for the next gunshow. I don't mind paying a little extra to the local guys if they have what I want, but within reason (I passed on several local SKS's that were beat to he!!, and about $100 or more overpriced than what I got a pristine unissued one for from AIM).
Usually, before I buy a gun, I do a TON of research online, figure out what the going prices are, look at all the local shops, see who has them and for how much, etc., and go from there. I surely would have been ripped off on numerous occasions had I not taken that approach. I don't impulse buy for this very reason, I learned my lesson on that long ago.