Fuel gauge only working sometimes

You can also have a problem at the large round pin connector on the circuit board itself. As stated before, wait until the problem happens then stop immediately and reach up under the dash and try to wiggle that big round connector to see if the gauge starts working. I have had the same problem before and replaced everything only to find out it's just a bad connection at that plug.

Good luck the circuit is very simple so it can only be a few things causing your problems.