If a piano is less than 10 or 15 years old and has not been in a high-use situation, chances are good that it doesn’t have any fatal defects, and may only need routine maintenance. Other than that advice, there are only a limited number of things you can do yourself to determine the condition of a piano. Most will give results that are only suggestive of possible problems, perhaps enough to rule a piano out, but not enough to be confident about buying it.
Some tell-tale signs of serious problems are: a water line inside the bottom of a vertical piano (the piano was in a flood); sawdust under a piano (termites); numerous rusty or broken strings, or many new, replaced strings amid broken and missing ones (a string-breakage problem); heavy rust in general; many notes that don’t play (action worn out, parts breaking, glue joints coming apart); piano is so far out of tune that individual notes each sound like several notes are playing at once (piano may be untunable).
The above list is, of course, only of fatal problems. There are countless other possible problems, ranging from the serious and expensive, but not fatal, to small nuisance problems and the need for normal maintenance. It’s strongly advisable, therefore, that you hire a piano technician to inspect any used piano you are considering buying. If the seller is a reputable dealer and the piano is covered with a comprehensive warranty, then you may be able to omit this step, as the risk is small. However, it’s not unusual, even with a reputable dealer, for a customer to hire an independent technician to inspect the instrument.
For a more comprehensive and illustrated discussion of things to inspect in a used piano, we recommend The Piano Book, by Larry Fine. An excerpt from The Piano Book that may help you do your own rough inspection of a used piano can be found here.