How to tell if a bike is good before purchasing?
New bikes are usually good to go. The LBS (local bike shop) will usually allow you to bring it back after a months time in order to readjust and tighten things that may have come lose. Ask about whether this is supported or not. Also ask about the guarantee and its exact details.

Also you could ask for a test ride (even in the parking lot) to make sure that the bike works.

Generally the bike should:


have inflated tyres
have no loose parts (grips, bars, saddle, cranks, pedals, wheels)
have working brakes
be able to shift gears smoothly