No, it's a myth. Goldfish retain learning for several months: laboratory experiments show that they memorize the location of a maze, associate a sound or light signal with a food dispenser, and distinguish shapes or colors weeks after the last training.
What conditioning studies show
Classic operant conditioning protocols have trained goldfish to pull a lever or cross an obstacle to obtain food. Once the association has been learned, it persists: individuals repeat the correct gesture after an interruption of several months, without complete relearning. Other experiments have shown that they learn to anticipate a precise time of automatic feeding, by gathering near the feeding point just before the scheduled time, proof of temporal memory and not just an immediate reflex.
In terms of visual discrimination, goldfish manage to differentiate between geometric shapes or colors associated with a reward, and maintain this ability at a level significantly above chance several weeks after the end of the training sessions. These results, obtained by behavioral neuroscience teams, directly contradict the idea of a memory of a few seconds: such forgetting would make any lasting conditioning of this type strictly impossible.
Consequence on aquarium detention
If the animal retains an environment and landmarks over the long term, a bare round jar without structure does not constitute a trivial simplification but a real sensory impoverishment: absence of hiding places, varied visual landmarks and space for exploration. A fish capable of memorizing a maze is also capable of perceiving the monotony of an environment devoid of stimulation. For any questions of well-being or breeding conditions adapted to the species, the advice of a veterinarian or an aquarium specialist remains recommended.