How can one run an app made for a more recent version of Android on an older Android Device? How can one install an app made for Jellybean and use it on Gingerbread?

Let's take Google Keyboard for example. Google Keyboard is meant for use with Ice Cream Sandwich and up, but say I want it on my phone running rooted CyanogenMod 7.2. Is this possible?
Technically, one can override the version requirement by cracking open the .apk file and editing the manifest.xml file and setting the  android:minSdkVersion attribute in the &lt;uses-sdk&gt; element to your sdk version (or simply remove that attribute altogether, in which case it will default to "1" and assume it will work on any Android version), then using your modified .apk file to install it.

However, this is almost always a bad idea.  The developer of the application presumably set that requirement to the value it is because they actually do need something introduced in that sdk version.  If they didn't, they'd set it to something else or omit it .  Trying to make the app run on an Android version missing those features it needs is likely to cause havoc, crashes, force-closes, and other unhappiness.

In the case of Google-made apps, I would assume they knew exactly what functionality their app uses and when it was introduced and that it would definitely break in some manner without that functionality when they set the minSdkVersion for their app, and thus trying this trick will almost certainly fail.

But if the developer is just a lazyish type who insisted upon setting the attribute (probably to the current version) without much thought about whether it's really needed (i.e. "I don't feel like going through my code and checking what functionality I actually use and when Google added it to Android, so I'll just set the minSdkVersion to the current version of Android"), it might just work.  Or the missing functionality might only be used in some part of the app you never use, and thus the brokenness is irrelevant to you.