If you're on a phone with a UI overlay that has the stock keyboard disabled (eg, Samsung TouchWiz, HTC Sense, Sony), you can just download the apk below- no root required. To install, make sure you have "install from unknown sources" enabled in your phone settings, and after installation, go into your phone's keyboard settings and enable "Android keyboard." Then, you can switch to the new keyboard. This may also work on some "stock" Android custom ROMs - but it will not work on stock Android builds distributed by Google. For instructions for Nexus devices running stock software, see the next paragraph.
Mirror 1 (APK)
Mirror 2 (APK)
If the apk doesn't work, you're running a phone that is either A.) running stock Android (as in, AOSP), or B.) running software that has the stock Android keyboard as an option, you'll need to download this ZIP file, and flash it in recovery. That also means you're going to need root. as you'll be writing to /system/apps. Before you do, though, either back up the stock keyboard (if you don't know how, you probably shouldn't be doing this) or create a full image backup, just in case. Here's that ZIP file:
Mirror 1 (flashable ZIP)
Mirror 2 (flashable ZIP)
Note: this build is an older one, and is not representative of exactly how the keyboard will look when Android 4.2 is officially released. The word suggestion pop-ups, for example, are different from what we've seen on Nexus 4s running the release build of Android 4.2. All the functionality is there and works properly, though.