Follow this link
http://www.theiphonewiki.com/wiki/index.php?title=Firmware
and scroll down till you see the 3GS firmware.
Then download the IPSW file and research how to unlock it.
As per the link it is now possible to unlock it (use any carrier) and jailbreak it (install any software)

Good luck