How can I back up apps which are no longer available?
I eventually figured out a solution.  iTunes has an option to back up apps from the phone, which is called "Transfer Purchases".  It moves around in every version of iTunes, but it should be there.  Because I was using an iTunes installation associated with a newer iPhone as well, I had newer, incompatible versions of apps already downloaded, so transferring would not overwrite them with an older version.

In order to transfer the apps, I created a new user account on my mac, authorized it with my apple id, and then I was able to transfer purchases off the iPhone 3G to this new account.  To be safe, I then copied the files out of the iTunes Media folder, just to ensure that I won't accidentally do something in iTunes to destroy these files.