Exhaustive technical explanation of signing & verification
This should get you started on public key verification: **Digical signature

In essence, the bitcoin address is the public key.  A hash is created of the transaction and this value is then encrypted using the private key that is known only to the owner of the bitcoin address.  Anybody can then use the public key (the bitcoin address) to decrypt this hash value and determine that the transaction has not been modified by creating a hash of the transaction and then comparing it to the decrypted value.  This serves a two-fold purpose: it protects against transaction modification and it proves that the transaction creator has access to the private key for the bitcoin address.