The nut of an electric guitar is the thin horizontal piece where the strings run through slots below the headstock on the neck. On most guitars this piece is meant to be installed permanently, but occasionally the glue or epoxy used to attach it to the guitar's neck will fail and it can separate from your guitar. Removing the nut is also a way to adjust the action of your guitar, it can be lowered or raised depending on the player's preference, and installing it is very simple.
It may be necessary to remove the dry glue from the factory installation to create a strong bond with the guitar's wood. Gently file this away, but be very careful not to damage the surface of your guitar.
Place a few small drops of super glue where the factory glue use to be.
Replace the nut. If the nut does not stay in place on its own, you can gently secure it with a small clamp. Place scraps of felt or fabric between the clamp and the guitar so you do not scratch or leave an indentation on the surface of your guitar.
Allow the glue to dry completely.
Restring the guitar and play away! The glue and the strings should hold the nut in place securely.
Make sure you are comfortable with the action of your guitar. This is an opportunity to adjust your action just right--players make this adjustment often on acoustic guitars. If you would like to raise or lower your action at the nut, now is your chance!