The first things to decide when buying a classical and/or flamenco guitar are how much you want to spend and how "high-end" of a guitar you want to buy. Both classical and flamenco guitars range widely in both price and quality. Cheap, factory-made, beginner guitars can cost around $150. Decent, factory-guitars can range between $250-$900. Great factory guitars run between $1000-$1800. After that, you're looking at hand-made guitars. Those run anywhere from $1,000-$15,000 depending on the maker and quality. Collector guitars (from famous deceased luthiers) can be upwards of $200,000.
In any case, here are 8 basic things look for when buying a good classical or flamenco regardless of your budget:
1) Make sure the top, back, and sides are solid wood and not composite (This usually will start you at around $250).
2) Make sure the guitar has a good range of volume and that you don't need to dig in to get a good sound.
3) Make sure the guitar feels easy to play. Is the neck too thick? Too thin? Is it hard to play in 1st position (i.e., scale length too long)? Action too high? Too low?
4) Play each string on every fret to make sure there is no unintentional string buzzing (i.e., uneven frets or action is too low).
5) Are the frets sticking out of the top/bottom of the fret board (i.e., wood is too dry) or are they protruding out (wood is too humid).
6) Make sure the guitar doesn't have any cracks in it!
7) Does the top have a tap-plate ("golpeador")? All flamenco guitars should have one and many classical guitarists are opting to have one installed as well. The tap-plate does not affect the sound, so I'd recommend getting one whether you will play classical or flamenco.
8) What is your fret-board made out of? Should be ebony.
If the 8 basics above are met, then you need to decide on price & quality. Generally the better the wood grain, the higher the price. And, of course, the better the construction, the higher the price. French polish (as opposed to lacquer) allows the wood to vibrate more, but it's a labor intensive process, so you price will be higher. Finally, if you custom order a guitar, your price will be higher as well.
The kinds of wood that your guitar is made of may vary, but here are a few popular options for both classical and flamenco:
BACK & SIDES: Cyprus or Rosewood
Many people decide they like the sound of different woods for the top, sides, and back, so you'll have to play different guitars to see which sound you like most.
If you're serious about buying a high-quality guitar, I highly recommend Richard and Marshall Brune in Evanston, IL: www.rebrune.com