Goldfish have a memory-span of at least three months and can distinguish between different shapes, colours and sounds. Fish respond to certain colours most evidently in relation to feeding. Fish learn to anticipate feedings provided they occur at around the same time every day.
Goldfish, like almost any fish, are aware that they are prey animals. In order to feel comfortable, they need to have lots of hiding places so make sure you put a fish ornament in their tank along with some fish plants and gravel.
Goldfish can be kept in the same tank as fish with similar care requirements and temperament, i.e. water temperature, size etc.