the Cat shaking his head picture is courtesy of peter_hasselbom
Why do cats shake their heads?
Ear mite is maybe the cause of it.
Ear mite are microscopic creatures who lives inside animals ears.
They can be transmitted even from brief contact with another cat or dog.
It is rear for human to get infected.
If your cat is scraching his ears and shake his head a lot, It's a sign for ear mite.
Ear mite possible sign is something like black dirt inside the cat's ears.
A lot of scraching and shaking, without the "black dirt", can also be ear infection.
Either way, It is a good idea to get your cat to the vet.
The vet will take a sample from the black dirt and put it under a microscop.
If he'll see this... It's Ear mite...
The treatment is probably will be some kind of ear drops, twice daily.
(Ear mite picture from wikipedia, Entry: ear mite)