Check for an open in the wire harness to the speed sensor form the PCM. At the PCM connector C2 (middle one) Terminal 25 Dark Blue/Black and Terminal 28 Light Green/Black.
With the engine off, cycle the ignition on and off 3 times quickly leaving the ignition on the last time. The odometer will display the codes in the PCM. f the codes are not active you may be able to clear them with the odometer reset button. If this does not work you will need a OBD scan tool to clear the codes.
It is most likely the fuel level sending unit, but worth checking it before tearing into things. The fuel level is measured by the PCM, and relayed to the dash over the CAN. So if you are only losing the fuel level gauge intermittently is is most likely not the dash. To check the circuit, disconnect C1, C2 & C3 (the three 32 pin terminal connectors of the PCM). The PCM is located on the firewall on the passenger side of the engine compartment. Connect a ohm meter to Pin C3-26 Fuel level sensor return Dark Blue/White and C1-4 Sensor Ground Black/light Blue. The circuit should have continuity. The fuel tank does not have to be dropped to change the sending unit/fuel pump assembly, instead lift the bed. To lift /tilt the bed * Disconnect the fuel filler neck form the bed (4 screws around the filler neck/gas cap). (1) Remove the ground strap (forward passenger side of the bed) from the frame or bed. (2) Remove all but the rear two mounting bolts that hold the bed to the frame. (3) Loosen the rear two mounting...