I've seen people get ripped off many times while purchasing a guitar or bass. I feel it's required you know what your doing before spending your hard earned cash.
Here's some general tips about buying a guitar:
Take along an experienced player who knows how to select a guitar. I'm serious about this one. Do not buy without someone who can at least play somewhat - preferably a pretty good player - and knows something about how to pick a good guitar. Otherwise you are an absolute babe in the woods.
Don't let the salesperson play the guitar for you. This is almost as important as #1. Most salespeople are good players. They can have some stock riffs and they can make a $150 piece of junk guitar strung with barbed wire sound pretty good. This means nothing! Evaluate how the guitar sounds by either strumming a couple chords yourself and by the evaluation of your buddy (see #1).
Don't tell them how much you want to spend. If you do you may as well just give them that much in cash and then take whatever they give you. If they push you can either leave or you can answer, "I'm willing to spend as much as I need for a decent set-up - anywhere up to a couple thousand dollars." Say this even if you only want to spend two or three hundred. Saying you want to spend two or three hundred and you'll get directed to the "crap" section.
Have someone - anyone show you a couple chords or riffs before you go shopping. Even with a buddy, you'll want to touch the guitar - you'll want to know a couple chords so you don't loo
k too much like a newbie. You don't need to know a song or anything ... just a simple D or G chord will suffice.
Physically check out the guitar. First, look at the neck like you're checking out a pool cue for straightness. Sight it from the headstock to the bridge and from the bridge to the headstock. Look for anything that may be present. (i.e. bow in, bow out, high frets, twist, humps.) Bow in and bow out can be adjusted by a truss rod. High frets can be reseated. Twist and humps (no adjustment) is a characteristic that if not too bad may be tolerated.
If you are truly a beginner, buy a used guitar and have it set up for you at the store. That way you be out as much money if you decide to quit playing.
Price and value debate. Basically you have to ask yourself how much can you afford to spend and could you afford to 'upgrade' your guitar sometime down the road if it becomes necessary? For instance most of us get a real clunker for a first car (Yamaha in my case) but later on might get something nicer when we can afford it.
Here's some tips for buying an electric guitar:
If you're going to buy an inexpensive amp, test guitars through an inexpensive amp. Hey, even a cheap guitar sounds pretty good through a $1,600 amplifier. You want to know what you have.
Amps are important! Don't buy one as an after thought. If you can't afford both, consider buying a decent guitar first and an amp later. Yes, you can play an electric guitar without an amplifier.
I hope this was helpful in one way or another, be the best you can be!