Despite being a relative newcomer to cycling, I seem to get asked this a lot, so rather than write the same advice out every time I thought I'd put my opinions down here. This is mostly aimed at the casual cyclist looking to gain fitness, commute or just have fun.
I've tried to avoid fashion or hype and provide links to elaborate on my suggestions. I love new shiny kit as much as the next cyclist, but you should be under no illusions that having slightly lighter wheels or carbon fibre cranks is going to make a measurable difference to your riding. However, you might pedal harder on expensive kit if you're keen to feel that you didn't waste your money. You only have to look at the wide variety of bikes on which people rode Paris Brest Paris or the guy who did the Tour de France route on a Chopper to realise that you don't need the latest greatest kit to take on ambitious rides. So don't re-mortgage your house just yet.
While this is to some extent a personal question, some general guidance may be helpful. At the time of writing I would say that it's hard to get a decent, reliable new bike for less than £400. If you have less money to spend than that, I'd suggest buying second hand if you have the time and inclination to do some research.
When you're spending around £100 on a complete bike, it's very likely to be a BSO, or "bike-shaped object" - a shiny piece of metal that will rust and fall apart when used. Buy cheap, buy twice.
To avoid ending up with a BSO: - Buy only from shops which specialise in bikes - not supermarkets or hardware stores. Find a shop where the staff understand bikes. - Buy a bike of a known brand for which you can find multiple reviews online.
Fit. The size. The shape of the bike compared to the shape of your body. Nothing I mention further down is more important than this.
Get this wrong and your riding will be inefficient and uncomfortable. No of top-of-the-range groupset will compensate if your knees are locking out or your hands hurt from pressure on the bars.
A bike that fits will be a joy to ride, you'll be able to ride further in comfort and want to do so more often, so you'll end up fitter and faster. Fit is more important if you intend to be riding all day.
So how do you get it right? There's a risk that the guy in the shop may want to sell you the bike which is in front of you, so it's a good idea to have an idea of your right size before you start shopping. You can work this out for yourself with a tape measure and some online advice. If you're really serious or an unusual size, you can also seek the advice of an independent professional. A good local bike shop ought to help you get the basics right, however.
If you're serious about efficiency and/or comfort, then once you've bought a bike that is roughly the right size you can pay to have an expert "fitting" to work out your optimal saddle height, reach, crank length, etc. If you're keen on increasing your speed, this is probably money better spent than that groupset upgrade. For the casual commuter however, unless they have any serious issue with comfort, a full professional fit would be excessive. If you don't have the budget for that, but want to sort out some comfort issues yourself, there's a helpful guide to DIY bike fit here.
You should ask yourself what kind of riding you intend to do. Some things like pedals or saddles are easy to change, but other things are more fundamental. I've probably missed a few, but here are some questions you should think about. - Do you want drop bars (more aerodynamic, more varied hand positions for comfort), or straight (simpler, better control on rough ground), or something else? - Do you want to carry kit on the bike? This is generally easier and more comfortable than carrying it on your body, especially for longer distances. Not all bikes have rack mount eyelets built into the frame and while there are alternative solutions, they might not be ideal if you want to carry anything other than bike spares and clothes. If you want to carry a lot, then it may be worth going for a touring bike which will having longer chain-stays so that your heels clear the rear panniers when pedalling.
The size. The shape of the bike compared to the shape of your body. Nothing I mention further down is more important than this.
You should ask yourself what kind of riding you intend to do.
If you like the fact that there's a small, independent retailer and repair shop in your town, then you should at least consider buying a bike from them.