I've the same problem.
I bought iphone 3G (activated) from ebay and I clicked restore from itunes.
Suddenly, it locked.
It said "Insert an unlocked and valid SIM to activate iphone".
What should I do in order to activate it?
Can I use my friend SIM card (AT&T not iphone plan) to activate at AT&T?
I've no idea how to activate my iphone. I shouldn't have restored from itune, right?