Can Facebook and other iOS 5.0 apps be installed for iPhone 3G on iOS 3.1.2?
I recently found my old iPhone 3G with iOS version 3.1.2. I'm planning to let my 4-year old nephew to use it. But then, I'm having a problem on installing apps like Facebook, Twitter, Instagram, etc. because these apps only support iOS 5.0 or later.
How can I install the apps I mentioned?
Note: This answer is no longer valid.
(See @stuffe's answer on how to install apps onto old versions of iOS)
The short answer is there is no way to install an app that was created for an iOS newer then the one you are running. You should connect the device to iTunes and see if you can get it updated to the latest 4.x iOS as many games and apps that target the 4 to 8 year old demographics will certainly work on that older OS.
The longer answer (and some related discussion on this site) is that developers of more powerful apps want to use the latest APIs that are introduced every iOS, and for a developer to create an app for an older iOS version, would mean he couldn't use the newer tools. Worse, it's more work to keep using the older API so cutting them makes schedule and financial sense. For example, a resource known as ARC (Automatic Resource Counting) has made a huge difference in reducing the time and cost of app development by automatically doing things that otherwise the developer would have had to manage.
Because these necessary APIs don't exist on pervious iOS versions, there is no way to run a newer app on an older iOS. Hopefully you can use the web versions or find acceptable apps to do the things you need this device to do to continue to be of use.
As of the time this question and most of the answers was posted, it was not possible, however it is now possible to do this on an iPhone 3g running iOS 4.2.1 though not iOS 3.1.2. Simply try to download any app, and if the current version is not compatible with your device or OS, and a suitable older version existed at some point in the past that was compatible, if will offer to let you download that most recent compatible version instead.
Owners of iPad 1s and 3G/3GS devices or older iPods rejoice!
In general, you can't.
Apple hase changed their most current releases of their iPhone development tools so that the minimum Deployment Target is iOS 4.3. Thus, any apps built with the current version of Xcode will not run on devices running older OS versions. Any developer who wants their apps to look good, or use the latest features on the latest devices (iPhone 5, etc.), can no longer submit apps or updates compatible with iOS 3.x. So a vast percentage of apps updated since Sept. 2012 are no longer compatible with an iPhone 3G, since a 3G can not be upgraded to iOS 4.3.
The iTunes App store only offers downloads of the latest version of an app from the App store, so older versions are no longer available (except to customers who have previously downloaded these old versions and made backups in case iTunes tries to trash these working versions.)
A few developers still use older development tools; and some apps have not been updated recently. Those fewer apps are the apps suitable for you device. But they may or may not be the ones you want.