How to know if a transaction is valid?
On the bitcoin wiki, there is rather complete list of validation checks that are done by the Satoshi client: Protocol_rules.

There is a section specifically about transaction checking as well.