Why does Windows change the input language randomly?
Solution 1:
The input language settings are per-application. An application which calls a Windows API in order to change the input locale, can set a different keyboard layout, if it is enabled for the user.
Sometimes it also happens, if you accidentally hit the ALT and LEFT-SHIFT keys together. If you don't want to have this behavior, you could "uninstall" all input languages/cultures you don't need in the Control Panel:
Regional and Language Options > Text Services and Input Languages
EDIT: or just check "Turn off advanced text services".
Solution 2:
It most likely happens because you hit that Alt+Shift shortcut key by accident.
Personally I remove all other languages from the language bar AND disable the shortcut key. After I have done that, it has never happend again =)
How to (On Windows Vista, and probably Seven): Right-click the language bar and choose Settings... (or go to Control Panel, Regional and Language Options). Then go to Keyboards and Languages tab and click on Change keyboards..., select the keyboard(s) you don't have and click the Remove button. Go to Language Bar tab and choose Hidden in the Language Bar group box. Go to Advanced Key Settings tab, then in the Hot keys for input languages select Between input languages, click the Change Key Sequence... and choose Not Assigned in both group boxes. Finally hit OK, OK and OK.
Solution 3:
I think the input language is maintained per-application. I'm not sure if there's a way to disable that behavior.