First Law of Spying - NEVER switch colors in your own base. It screws teammates up and wastes ammo.

Second Law - Going in the front door is usually bad. Use a side entrance if possible. Less chance of the other team noticing.

Third Law - Take out all sentries and snipers. Grenades don't blow your cover.

Fourth Law - Feigning and talking is good. Feigning silent is bad.

As a beginner spy, dont go gung-ho and charge in with prospects to capture the key and get out without a scratch. You wont. In fact you would be better off helping your team out by destroying sentry guns and taking out snipers with your knife.

Learn every map that you play on. Know them inside out and backwards. Know them from either team's side and every secret. To a spy, knowlege is power, and if you know where every shadow is, and every good gun placement spot is, you will be prepared for everything. Anticipate ambush zones and eliminate them with gas.

The "id" command is bad news. Engineers use it all the time. Dont stand around, and if an Engineer starts shooting, and you arent sure if he has backup, run, he probably does. Lone Engineers are no threat. Don't get caught off guard! The railgun does a LOT of damage against light armor. Luckily, most Engineers can't aim.

Change skin often. Never go in with the same skin twice. Even change skin in an enemy base a few times. A smart enemy will call out "sniper is spy" and if you just changed to demoman, then you are all set!