These are instructions on how to enable multitasking on iPhone OS 4.0 for the iPhone 3G.
To follow these instructions you must have a jailbroken device. Please note that until iPhone OS 4.0 is released only developers and advanced users should attempt this.
You can learn more about jailbreaking your device here.
Make sure you have installed OpenSSH and found your iPhone's IP Address.
Launch Fugu from your applications folder. If you don't have it you can install it from here
Input your iPhone's IP Address into the Connect To: field and input root as the Username then click Connect.
Input alpine as the Password unless you have changed it as suggested here. Click Authenticate to continue.
Once logged into your device click the Go To... button on the toolbar.
Input /System/Library/CoreServices/SpringBoard.app/ into the entryfield, make sure Remotely is selected, and click the Go button.
Scroll down the right panel and locate N82AP.plist. Drag this file from the right panel to the left panel to copy it to your computer.
Open a new Finder window by clicking its icon in the dock
Double click to open N82AP.plist.
Click to expand the capabilities section.
If multitasking isn't in the list right click (Control-Click) capabilities and select Add Row from the popup menu that appears.
Name the new row multitasking and set the type to Boolean. Make sure the value checkbox is checked.
Click to select Save from the File menu.
Return to Fugu and drag the N82AP.plist from the left pane to the right pane.
When prompted click the Overwrite button.
Restart your iPhone 3G to use the multitasking features we just enabled!