What you want is called "[tethering][1]".

[Here][2] you can find apple's official stance on it.

There's quite some [other ways][3] explained on the internet how to do it once you know which term to search for ;-)


  [1]: http://en.wikipedia.org/wiki/Tethering
  [2]: http://www.apple.com/iphone/iphone-3gs/tethering.html
  [3]: http://www.google.com/search?q=iphone+tethering