Prepaid t-mobile sim card in a iphone 3g?

I recently bought an i phone from my friend and right now i don't want to be locked into a cell phone plan. So i'm wondering if i could just go to walmart and buy a tmobile prepaid sim card. The ones that are talk, text, and web for 50 a month. I heard from somewhere that if i did that i wouldnt be able to get on the internet and i don't really care for all that. All i need is calling and texting

You can't because it is locked into the company's service you need to find Someone to unlock it then you can get a prepaid plan at tmobil and only pay 50 per month that's what do