Straight up, I live in Australia, so I can't provide US-specific advice. But hopefully my experience of buying might give you some idea how I went about it.
To give you a picture of my city, I live in
$1, South Australia. I have been here all my life. Adelaide is the smallest capital of the mainland states, and is also the most affordable. It consists of a ~2km square CBD, surrounded by a band of parkland about ~1km deep, then suburbs. The city sprawls north-south being flanked by ocean to the west and hills to the east. The thing about Adelaide is that while it is of modest size (~1.3m people), population density is low compared to what you'd be used to (Australian cities are all sprawling suburbs of detatched and semi-detached houses around small CBDs).
I've always considered rent money, dead money. My intention was to live with my parents (who are 1-1.5 hours outside the CBD by bus) till I got into the workforce. I saved up a deposit over the course of university from my pension, four years of part time work, and 10 months of PhD scholarship (I quit). I started working in 2013 and immediately started looking.
I knew I wanted to be no more than 30 minutes by public transport from the city and I wanted shops (supermarket) within a 10 minute walk. I also wanted three bedrooms (space for hobbies and a place for my mates to crash). Checking public transport routes told me which suburbs to look in and adjacent to. I also narrowed down to specific streets I preferred over others (e.g. not main roads, closer to bus stop etc). The location of shops was something that was really considered after looking at the property (if something is within 30 minutes walk, I don't mind walking the distance. I'll even walk further on occasion).
I very quickly found the property I would end up buying. It was the size I wanted, with access to different public transport routes (maximum 20 minutes into the city), shops (including a bottleo - i.e. liquor store - which is obviously the most important thing) all within 10 minutes walk, and it was a new build in a decent area (basically an area undergoing change. Old stuff gets knocked down, 2-3 are built on the subdivided block).
I've gone in hard on paying off my mortgage. The property is very rentable, so once my mortgage is done I can easily purchase somewhere else - say if I met a girl, want to start a family, get a family home etc or even move interstate - and have an asset with a guaranteed income stream.
So in terms of general advice:
* Know what you want (size, distance, location), have some level of flexibility, but don't comprise to the point you make your desires irrelevant (otherwise you'll buy something you don't want)
* Newer is better. The older the property, the more problems you're going to inherit (and that's more cost to you). If you can, nothing older than a decade or two.
* Make sure you inspect it properly. Get someone to help if necessary. You should always have a full building inspection and report compiled before purchase (in South Australia this is done as part of the finalisation of the contract, so you can raise issue or back out if there are big problems).
* Know your price limit. I don't know how loans and the banking system in the US works (I understand there is a preference for fixed interest rates? That's insanity to an Australian), but make sure you've enough of a deposit to avoid loan insurance (if you don't know what that is, I can explain) and variable over fixed loans all day, every day.
* Know what you're getting into. If the property isn't Torrens Title (detached house, you own property and land), make sure you check the body corporates by laws and costs etc. Don't get into something that is going to screw you over.
* Also know local laws (i.e. council regulations) and rates. I don't know what the US is like, but they can vary vastly from council to council here, and some you just want to steer clear of (I can explain more if you're interested).
* Finally, when you do buy, PAY IT OFF ASAP. Seriously. Banks and financial advisors will tell you otherwise, but a loan is an expense. Get rid of the expense, you've got access to credit *and* better income, not just access to credit.
On potentially moving cities, the advantages of staying in the city you know are that you know the city, so you know how things work, where to get things etc. The people might also know you and help you out. For me, my parents live 15 minutes drive away (but 30-45 minutes by public transport), and I often ask my mum to take me shopping (e.g. for clothes or hardware, or if it's pouring with rain and I don't want to get wet going to the supermarket). It's also going to help you choose your suburb better (i.e. you know which ones to avoid so you don't get stabbed).
On the other hand, if you're living in an expensive city, a more affordable city is going to give you a much better quality of life. For example, Adelaide's job market right now is the toughest in the country (I'm sweet, I'm a public servant with a job for life), but if you do have work here, your income goes further, you don't have to commute as much, and there is easy access to the beach, wine regions, etc. It also depends on what you do for a living (or what your partner if you have one does) and how easy it is for you to find something and make that move.
And this comment got really long. Hope some of it is useful and if you have any further questions, just ask.