1- You need to get an unlimited data plan from T-Mobile otherwise it would be pointless using the internet features of the iPhone that would cost a fortune.
2- Once you set up a data plan, go to settings, general, network, edge and put in these settings
APN - internet2.voicestream.com
username - guest
password - guest.