My son has done the headbutting thing in 2 ways/situations - one seems to be a game, when he is sitting with me playing, he headbutts me. He seems to think it is very funny, but damn, I think he cracked my nose a few times already.
The other were a few times when he was throwing a major tantrum, he would headbutt the floor - and did it so hard that he even had a red mark and a bump.
I have read that a lot of headbutting can be a sign of autism, but he has subsequently been to a neurologist and psychologist (related to his speech development not the headbutting) and they have both confirmed that he is definitely not autistic.
The neurologist however put him on Risperdal to help with his sleeping and concentration problems and it has helped a LOT with his tantrums and the headbutting is history now too. (They say kids with speech development issues get more frustrated because they know what they want to say but can't express themselves and therefore they throw more tantrums than other kids).
I hope some of this info helps you in some way!