Assuming the actual gauge is not broken, this is a problem with main fuel pump sensor or the slave pump sensor or the wiring from the tank to the dash area. Each pump has it's own fuel level sensor. If one of the sensors goes bad the gauge will not work correctly since it's not getting the complete signal. The gauges are part of the pumps. The pumps can be accessed by removing trim and shelf that is behind the seats. You will see two large access ports in the body steel pan. Remove those and you will see the tank caps/hoses/wiring. It is recommended to loosen (not remove) the fuel tank straps under the car at one end. This will allow the tank caps to better align with ports. Loosening the straps is not absolutely necessary. I was able to replace both pumps without loosening the straps (everything was corroded and the actual motor was bad). Rent the proper cap removal tool, trust me. Also reinstalling the cap while keeping the gasket properly installed is a pain. By the way the slave/jet pump should really never go bad except for the level sensor.
I had the same problem with my Jag. in my case there was a float inside the tank which failed with age and needed to be replaced. Had to drive to get as much gas out of the tank as possible which is of course not easy to do when the qauge isn't working.