One big problem is that many teachers are teaching keyboard shortcuts first, when they should really be starting by teaching the actual menu command first. Because although Command-I is the default shortcut for inverting in US English, the shortcut might be different if someone customized the shortcut, or changed the shortcut set, or is using a different language. If they taught where the actual menu command is, you’d always be able to find it even if you forget the keyboard shortcut or if the shortcut gets changed.
Given the document state you show in your screen shot (8 bits/channel RGB, with a pixel layer selected), what should always work is to choose the menu command Image > Adjustments > Invert. While you do that, take a moment to note what the currently set keyboard shortcut is for Image > Adjustments > Invert, and in the future you can press that shortcut.

If you want to make sure you are using the default Photoshop keyboard shortcuts, choose Edit > Keyboard Shortcuts, and make sure that the currently selected keyboard shortcut set is Photoshop Defaults. If that is set, and the language in use is US English, then Command-I should be the shortcut for Invert.