One of the very first things I look for is overall condition of the metal. Is the bluing mostly gone (shows signs of a lot of use)? Is there any rust anywhere (shows possible neglect)? Are there any readily visible defects? I recently saw an old Stevens Springfield 20 gauge and the guy was asking $50 for. I picked it up and the first thing I saw was a huge split in the receiver!
Look at the barrel(s) and check for good rifling, or a smooth shiny bore for shotguns. Move the barrel(s) up and down and side-to-side. A little movement may be OK but if it's sloppy it may not allow the primer to line up with the firing pin. If possible, put your finger over the firing pin and pull the trigger. It might hurt but it's worth the check! The trigger should be smooth though it may be heavy.
Check the action and dry fire it a few times (except for .22 and then it's a good thing to have an old spent case with the initial firing pin dent marked). Everything should move smoothly unless it's rusty or covered in cosmoline. Bolts should move freely and may have some lateral movement while open but not budge a micron when locked in. Semi-automatic actions should lock to the rear after a trigger pull and an empty magazine. If gas operated look at the pistons/tubes as they are accessible. Pumps should move easily and lock positively when closed.
Check the sights or beads. All should be securely fastened and in-line. If it's a shotgun and it has a vent rib, check to see if it's tight or lose. Ask the seller if he/she/you can disassemble to look at its innards (only if you know what your doing!). If you know the manufacturer has a lifetime warranty (HP, Taurus, etc) regardless who owns it then you may have a great find even if it doesn't work right as long as there's no evidence of abuse/neglect.
Finally, if you're unsure, ask if you can bring a friend back with you to look it over or, if it's found faulty after a gunsmith looks it over or when live firing (for those in good working condition) if you can bring it back for a full refund. Don't ask that question if you find a pristine C9 for $50!
I'm sure I'm missing a lot but those are, at the very least, the basics. Hope it helps!
Mac