Identifying magic items
The Spellcraft skill will allow you to identify a potion with a DC 25 check. To clarify, this does not subject you to any negative effects in the case the potion is poisoned or cursed. Instead of sampling it, the character is just observing color, viscosity, density, weight, etc.
If you don’t have Spellcraft, or you fail, you can use an alternate method (also from the SRD):
In addition to the standard methods of identification, PCs can sample from each container they find to attempt to determine the nature of the liquid inside. An experienced character learns to identify potions by memory—for example, the last time she tasted a liquid that reminded her of almonds, it turned out to be a potion of cure moderate wounds.
To clarify, this approach does subject you to negative effects, if any, though a bonus to any saving throw may be warranted.