To check the sender:
Measure ohms between the main terminal on the sender unit and its metal casing. The ohm meter should read near zero when the tank is empty (float is down) and gradually increase to 30 ohms when the tank is full (float is up). The sender unit is bad if you don't get uniform readings between zero to 30 ohms.
To check the fuel gauge:
Remove the wire from the sender. With the key on, touch the wire to a known ground. The fuel gauge should drop to empty. Remove the wire from ground and the fuel gauge should read full. If the gauge fails this test, you either have a bad gauge or a bad wire from the gauge to the sender. Check the wire and its connections first before you spend big bucks on a new gauge.