Fuel gauge only working sometimes

If the temp gauge also stops working the gauge voltage limiter may be the culprit. These gauges and limiters do loose connection to the printed circuit board due to corrosion, and vibration.