Welcome to the forums. First I'd download a third party keyboard and then set it as default, so you can avoid bigger problems. You can try with this one.
After you have the keyboard installed go to settings - apps - all - select your stock keyboard and make sure it's enabled. In the same screen clear data for the app and restart the phone. Tell us how it goes.
Does this persist after a reboot? How about in Safe Mode, which disables all 3rd party apps you installed? On most Android devices, while powered on, press and hold Power until the Power Off menu appears. Press and hold the Power Off selection until the Safe Mode prompt appears. Tap OK.
Another option is to connect a basic USB keyboard via OTG cable, at least temporarily.