(outdated link removed)
^^ The previous owner must have unlocked it or your SIM most likely wouldn't work.
cydia works with iphone 3g right?
Not true. All iPhone 3G's will work with a Pay As You Go Sim. Only condition is the phone is activated first. If you buy any used iPhone 3G since it's already has been used and activated, you can just pop in any AT&T Sim (Pay As You Go also) and it works. Only reason I am even saying this is I don't want to be included in the jailbreaking unlocking crowd as I am against it. I talked to
AT&T and they said it was fine but I would have to purchase a used iPhone 3G which I did.