Just download the program winpwn2.5, and jailbreake, then unlock it that way. This for windows. there is a mac version for it too, but i forgot its name.
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?