If you are looking to choose a mountain bike, and want to actually use it off road, this is the guide for you. If you just want a mountain bike because they look cooler than road bikes, but you aren't going to use it off road... Keep looking!
First things first - budget. If you want a good bike with a budget less than £600-700, then you are better off buying second hand, and/or online. It really helps to have a LBS (Local bike Shop) handy until you learn how to fit/fix things yourself, particularly if you aren't buying new. Budget explained:
Budget is less than £700 = Buy Used, don't buy new.
Budget is more than £700 = Consider buying new, but used retains its value in terms of quality of parts for your money
As far as I'm concerned its not worth buying new unless you have a very large budget (or a friend at a shop who'll hook you up), because you will end up with better parts for the same price if you keep your eyes on ebay. Secondly, Hardtail or Full-Suspension? For a beginner, a hardtail is a better choice in the long run because its much less forgiving so you learn to pick your lines much better, and it helps you to develop your own style and riding position, which you can then transfer to a full-suspension bike should you feel the need (this will of course depend on your riding style). If you plan on throwing yourself in at the deep end and chucking yourself down steep slopes once you've established yourself with offroad riding, and having got to grips with the controls of a modern mountain bike; a gravity fed rig (downhill or freeride oriented) is the best way to go (but it is best not to skip the hardtail step before moving onto something like this). For a beginner, a popular (and low priced) choice is the Kona Stinky which for the price they can be bought 2nd hand do the job well and will last a long time, requiring little maintenance for such a bike. Other popular choices include the Transition Dirtbag (similar platform to the stinky but a little burlier built), Specialized Big Hit, etc. Higher end bikes such as the Specialized Demo/Trek Session/Giant Glory/Devinci Wilson/Intense 951/Intense M9 are popular choices among more experienced riders. If you're after something a little more well rounded (because the afformentioned DH bikes will never perform well on the XC circuit), the Specialized Pitch is a great choice as a fairly hardcore trail rig, especially for the price. Other popular choices include the Trek Fuel EX range, and equivalents from companies like Giant, Marin, etc are all very comparable, though it's worth trying before you buy; see if you can get in on a proper test ride, where you have the ability to try the bike in its natural habitat [off road]. Specification between different companies can vary quite dramatically even within one price range - so if you're split between a choice of two - go for a bike with higher specification componentry (eg. Shimano XT over SLX, or SLX over Deore).
As far as looking for a Hardtail goes, for all moutain use anything between 130 and 160mm of suspension travel is ideal, though you can get away with 100mm or more (depending on intended use of parts). As far as suspension is concerned, i'd USUALLY avoid anything 'ballistic', 'zoom', 'RST', 'Suntour', 'SR Suntour' unless you plan to upgrade them (though these companies do make higher end aftermarket parts, the OEM parts that come stock on bikes tend to be of low quality). I would stick to Marzocchi, Manitou, Magura, Rockshox and Fox. Everyone has their own opinion as far as suspension goes, but if you're looking to ride hardcore trails a fork with a 15mm or 20mm through axle is a good idea; for its security, strength, and stiffness.
Rear shocks are usually paired with the forks and so will be of a similar standard. Again, if you can afford it, Fox, and Rockshox are very good in these fields; the Fox DHX series is good, and good value for money. Derailleurs: I would stick to: Shimano: deore/lx, deore/xt, xt, xtr OR SRAM: x-7, x-9, x-0. Brakes: If you can get good quality hydraulic disk brakes they improve braking dramatically, and if you dont get a bike with disk brakes, i would make sure that the frame and the forks (unless you plan to upgrade these) have disc mounts - either I.S (international standard) or Post mounts are the most commonly available. Wheels need also be disk compatible unless you plan to change the wheelset then make sure the wheels have disk hubs (either standard 6 bolt, or the shimano centrelock). For brakes, from personal experience I would recommend Avid, Hope, or Shimano. Again, companies such as Tektro are to be avoided - they will never have the power of other brands, and won't last as long; not to mention that parts and pads can be VERY hard to get hold of. Bleeding cheap hydraulics can be a pain as well.
Wheels: For a beginner look for something burly, and use your common sense (look up reviews for rims on the web) but for those with a larger budget; Mavic are a popular choice (again, your riding style will depict your rim choice - Mavic EX 721 rims are popular for freeride/downhill and dirt jumping. Alexrims can be decent (and are often supplied with specialized bikes). As far as hubs go, if a bike is stock you aren't going to have much of a choice, but if you're looking at second hand bikes, any sporting well maintained Hope/High end shimano (XT, XTR, SAINT etc.)/Hadley/Chris King/Industry 9 etc. are definitely worth a bit of extra cash (as they will last longer, and hubs like the industry 9s have a lot more engagement points than something like a basic shimano hub, are easier to service, and will need much less maintenance - and of course will take more abuse)
Tyres, if upgrading go for Schwalbe, Maxxis or Kenda and choose a tyre designed for your riding.
Other hardware (stems etc.); Hope make some very good quality stuff (but it is at a high price point). Truvativ are good in terms of value for money. Bontrager make good quality, lightweight and strong componentry (eg. the Earl or Big Earl series). Smaller companies such as Sunline/Straitline/NS etc. are also of very high quality (but again, costly)
Things to make sure [with 2nd hand bikes]: Ensure the wheels are 'true' (that they aren't bent) Make sure the brakes and gears are working well (unless you're comfortable with tuning these yourself, because servicing through a shop all adds up - if a bike has recently had a new chain and cassette fitted this can save you a fair bit) Make sure the frame is not cracked or badly damaged (anything more than scratches or paint chips)
Essentially: If you're willing to learn basic maintenance and have a reasonable grasp of mechanics, second hand is the way to go! Just make sure you know what you're buying
If you have little or no mechanical knowledge, this shouldn't be a reason not to buy second hand, but it's worth getting a second opinion from someone who might have a little more knowledge. It helps if you're comfortable checking the bike out (eg. for play in the hub bearings) before handing cash over [consequently, face to face is by far the best way to make such a transaction].
If you want something fairly basic, don't plan to maintain it, or to learn how to, then buying a new bike will help alot (you know what you're buying, and will usually be offered some form of free service plan with a new bike purchase)