The process would undoubtedly be Operant Conditioning (for all the Psych majors out there!!) with Positive Reinforcement. Now, I'll try and spare you all the crazy animal training jargon.
The type of reinforcer being used is a primary (primary meaning that the reinforcement is something the animal requires for survival) Broken down even further, a reinforcer is something the animal likes... even more detailed, a reinforcer is something that will increase the likelihood of a behavior (not a trick, a trick is what a magician does- there's no deception in animal training) occuring again.
The reinforcement in this situation is the food, an item fish naturally like, it doesn't need to be taught, or associated with good things, which is good, beause I hear goldfish have an attention span of THREE SECONDS!
This behavior would have to be taught through scanning. One would have to wait for the behavior to occur (probably would be brought about by having the string on the surface of the water during a feeding). Then, one must bridge. There's a few ways I can think of to 'bridge' a goldfish. One would be to flash the lights in the room, get a flashlight to flash, or drop food into the water.
Now, you may be wondering, just what the heck is a bridge? Well, it bridges the gap between a successful behavior, and the reinforcement. The bridge allows a trainer to indicate a single moment where the animal performed a behavior optimally. So, by flashing the lights, you're saying to the goldfish, "GREAT JOB! Do it again! Here's some reinforcement (food) for a job well done!!"
and Lather, Rinse, Repeat. Soon, a goldfish will ring the bell (pull the string) whenever it desires reinforcement.
So, in essence, a lot of time and patience.
But it is possible! You just must associate the behavior of pulling a string to ring a bell with reinforcement.
I've seen photos of gold fish that were guided through underwater hoops with use of a target (extension of the hand, basically, a place for the goldfish to place it's snout and follow it so it could be guided where it should go.)
Hope that all makes sense- That's Operant Conditioning and Positive Reinforcement. It's SeaWorld's training method that I've adopted for all of my pets, and I don't have a single complaint! My dogs even take hand signals! (can you tell I'd like to train cetaceans in the future?!