I've read several reports of LG phones having problems with the keyboard. I recommend you to install a third party one from the Play Store, like SwiftKey and then set it as default. After this you could clear cache and data for the LG keyboard and restart the phone. Tell us how it goes.