The ONLY way is to know the mushroom. There is no single test, chemical or otherwise, that can be performed to see if a mushroom is poisonous or not. Most mushroom toxins are gastro-intestinal irritants (see question 2), and most of these chemicals are unknown.
This means being able to identify the mushroom and separate it from its poisonous look-alikes. The only way to get good at identifying mushrooms is to practice, hopefully in the company of other people who know what they're doing.