The brain and the nervous system
The brain is relatively basic in comparison to advanced animals (no cerebral cortex, seat of consciousness). However, certain parts of the brain are very developed (the sense of smell in particular).
Goldfish do have a memory according to numerous pieces of research: they can remember things for several months, so the idea that “goldfish have a memory of three seconds” is a myth.
Some goldfish have been trained to carry out simple tasks: for example, finding the exit in a maze, pushing a lever or a tiny ball to a goal, responding in various ways to certain colors of light or to certain sounds.
There is no need for experiments to realize that goldfish quickly learn to associate food and their owner, the precise place in the aquarium where food is given and even the time at which food distribution takes place if they are fed daily at the same time.
The nervous system is relatively underdeveloped compared to mammals. However, that does not mean that fish do not feel or even remember pain, contrary to what we have long thought.