So I spent some time yesterday trying to figure out how to unlock an old iPhone 3GS I had lying around, which would involve jailbreaking it first. If you want to give yourself a headache, try to jailbreak and unlock your iPhone. You have to be aware of things like what your phone's "baseband" is, know how to check the serial number to find out what week it was manufactured so you can guess whether it has an "old" boot ROM (good for jailbreaking) or "new" (not good for "jailbreaking"). Then you get to download a utility to jailbreak your phone which promptly crashes in the middle, leaving your phone in a state where it won't turn on when you press the power button and you have to do the special "boot into recovery mode" button/timing combo which is not exactly "up up down down left right left right B A", but not what you'd expect to do with your phone.
Anyway, I decided not to move ahead with my unlock because it would involve irreversibly breaking the GPS on the phone.
Yet somehow despite all my Googling, it was only after I had given up that I stumbled on a blog post that said if you have an AT&T account, all you have to do is contact AT&T customer support to unlock a phone that is out of contract. :P So I did that and it took ten minutes, haha. I did learn a lot about jailbreaking though, which could possibly be useful in the future.