How to check what network my iPhone 4 is on?

I bought it off a friend who didn't know what it was on either.
So i took it to a shop and the girl tried a few sims and said it was unlocked so i thought brilliant went and got a new sim (giffgaff) and then it didn't work, so i tried it in my friends phone (same as mine) and it worked fine!

i tried my girlfriends vodafone sim and it still didn't work!
How can i found out what network it is on! I know you can use the IMEI number i think, but dunno how.

Any answers would be good.

Sounds very much to me that is a nicked phone that has been taken off of the system.

How the IMEI number [that is in all mobile phones and devices that use mobile networks] works is when the device is first switched on a code is sent to the nearest cell mast. That is then check on All the different network computer systems. If the code matches, the log on continues and then locks on to the nearest network mast.

When a phone or other device is nicked and the owner notifies his network with that number, that number is then removed from every network computer systems.

Consequently that phone or device is now as much use as a paperweight. It will never work again till the end of time, no matter what network SIM card you put in it.