Can I restore an iPhone backup taken from a previous iOS version, or is there a better way to retain my data?
Yes, this is possible. The backups themselves contain application data and other information that isn't particularly version-specific (with the exception of going from 4.3 backwards, as pointed out by hobs above).
In fact, I had to do this exact process recently, going from 4.2.1 to an iOS 5.0 gold master on an iPhone using a backup, and it went off without a hitch. Developers who want to install a prerelease OS version must put their devices in recovery mode, clean install the OS, then restore application data and settings from a backup. I did this for my iPhone, which I hadn't upgraded to the latest 4.x OS, and everything came across cleanly to iOS 5.0.
The one thing to watch out for is that if you don't encrypt your backups (by selecting the "Encrypt iPhone backup" option in iTunes), your device's keychain will not be transferred to the new device. For non-encrypted backups, the keychain is only preserved when restoring onto the same device you backed up from.
Yes, you can. You can restore a backup from an earlier version of iOS to the current one. (I had to do it a few times on test devices in the past.)
In those cases, what I had:
- Devices with iOS x-1 synced and backed up.
- Devices restored to iOS x
- Devices synced and data restored from the backups (as iTunes usually lets you do)
You can be very confident that in your case it will work.