Have you tried to find out if it has been abused when it was a little fish? Or perhaps its parents were not very attentative.
Seriously, goldfish are carp and do like to be in company of their kindred. Even the company of a human is preferable to loneliness. Do as the others say, get another one to join it.
btw The fish can't see its reflection in the side-glass from within the tank. This is only visible from outside the tank and has to do with refraction. If ,however, you can place a mirror somehow against the side of the tank so that the fish thinks it is not alone, you won't need to get another one if you don't want to. It won't know it is looking at its relection.