Contact AT&T and see if you qualify to have your iphone unlocked.
If you do, then have it unlocked.
Go to T-Mobile and get service from them. All of the features of the ihone will not work with T-mobile as they are not an official carrier for iphone. No 3g connection, no visual voicemail and there are some other features I believe that will not work as well.