As I said in the title, keep inventory is not working. I have cheats on and no mods and I know for sure it is on.
It's hard to determine the cause of your problem without further info so make sure this is what you are typing
/gamerule keepInventory true
A common mistake is to forget to add /gamerule and instead just type /keepInventory, but this is classified as a gamerule. You must also remember to add a capital I for keepInventory
Make sure to include true at the end, this will activate the rule. Just swap false in place of true to turn the rule off.
If it's still not working, try restarting your Minecraft.