Unity flashlight issue

Again: Please use Code-Tags, because this is hard to read.

Using code tags properly - Unity Forum

The code as-is SHOULD be toggling your GameObject on every press of F.
Have you tried printing/logging what happens?