When I engage reverse on the manual transmission of my 2003 Nissan Frontier pickup truck, the reverse lights tend to sporadically turn on and off. I'm trying to figure out what path to take to determine where the fault lies without hopefully having to trace and inspect the wire from the cab to rear of the vehicle looking for points where it is grounding out.
There are only a few parts in play here. The reverse light switch in/on the transmission, the wiring to the rear of the vehicle, the tail lamp assembly, and the lightbulb itself.
I would check the bulb first. If the filament is broken in just the right way, it can cause the flashing symptoms that you're experiencing. The part number for the bulb is 3156 (single filament). If that's ok, see if you can get access to the reverse / backup switch in the transmission.
With it still in the car, test it with a multimeter to see if it reliably turns on and off (if you can access it). Alternately, you can unscrew it from the tranny to test it, but I imagine it will be difficult to get at. You may have to remove the shifter boot to access the switch, or you can try to get at it from below.
Does adding extra pressure to the gear knob (holding it in place) help when backing up? If so, that points to the switch being at fault (or to an alignment issue between the gear lever and the switch).
Next set the parking brake, ignition on, trans in reverse. The lights should be working. Now wiggle the wiring harness from the switch where it comes out of the transmission as far up as you can reach while someone is watching the lights in the back to see if they blink on and off. Do the same for the harness running to the tail lights if you make the lights blink the open wire will be in the area where you are wiggling.
If you have a two prong switch as shown in JeremyP's answer you can simply jump across the connector on the harness side (Just make sure you use something small so you don't spread the contacts out or you will create the problem you are trying to fix) back up where you have made the lights blink before and see if they still blink. If so further inspection/repair of the harness will be required. If not it's a safe bet it's the switch, or the adjustment of the switch
I made sure switch worked before inserting it. When it was inserted the switch button would not linkup with the shift lever (oh crap!). I removed it and found there was a way to lengthen the button shaft by pushing down on the switch button and releasing it quickly. Once I got the switch button to extend to the fullest length it linked up fine and the lights turned on. My replacement switch button appeared to have 3 positions: regular (shortest), long and extra long.