In reply to buzby:
Unlocking iphones isn't simple because it is a server based system and can not be done by a phone shop plugging in a cable and clicking a few things on the computer!
If you were the original owner and the phone is now out of contract you can simply contact your provider and they'll take the phone off their 'white list'. The best and easiest solution however in your situation is to use an unlocking agent. Go on ebay and search for iphone o2 unlocking. You'll see lots of buy-it-now ads for this service, you buy-it-now and when on the payment page, click 'add a message'. In the message text box, carefully enter the iphone IMEI number. In about a week you'll get an email advising that it has been done and the steps you need to update the phone. This is usually simply to insert a non-O2 sim card in the phone and plug the phone into iTunes. It'll be unlocked as if by magic!
What you have paid for is the agent gets the provider to release the phone off their white list and then for apple to add it to their database (hence why you have to connect to iTunes afterwards)
The ebay agent service works very well and I've unlocked countless phones this way for customers, in fact I've just had the email from an agent to tell me a iphone 5 unlock I ordered last Saturday is now done.#
You are very lucky that the phone is O2. This is one of the cheapest to unlock, £9.99. Vodafone unlocks cost about £17, EE is expensive at 50 odd quid and 3 unlocking is a stupid £70 odd! Its the providers who ramp their costs to make it this way.
I can PM you the O2 unlock agent I use on the bay of E if you like.
Oh, just one thing. From the moment you order the service until after its been done, 'find my phone' has to be switched OFF. Dunno why, just something to do with Apple and their quirky systems