You need an image layer, or layer mask selected in order to use Invert. The image layer should not be locked, unless it is the background layer. i.e. you can invert the Background layer despite it being locked, but you can't invert other image layers if they are locked.
The layer lock icon is at the top of the layers panel, and looks like a little padlock