A number of iPhone users have reported loss of cellular data access (3G or EDGE) after the update to iOS 4.0.
Reset all settings. Try this first. On your iPhone, select Settings, then Reset, then Reset All Settings. This will result in the loss of data created since your last backup, but may solve the problem.
Restore, but not from a backup. One less-than-ideal fix for this issue involves restoring the iPhone as a new device rather than from a backup. It appears that bad holdover data from iPhone backups can cause loss of data access. Restoring as a new phone will delete contacts and other data, but generally resolves this problem.
To do so, connect your iPhone or iPod touch to your computer, click “Restore” in iTunes, then choose “setup as new phone.”
Some incidences of this issue may require a DFU restore.
Download new carrier settings. On your iPhone, go to Settings > General > About. If prompted for a carrier settings update, install it.
Otherwise, go to http://www.unlockit.co.nz/unlockit/ on your iPhone and download new carrier settings.