Well the first thing I'm going to tell you is that a 5 gal tank will quickly kill a goldfish . Either by stunting or extremely fast waste buildup. Do not get a goldfish whatever you do. PLEASE.
Goldfish are a LARGE growing species. Normal looking types ( single tails, long straight bodies ) and shubunkins grow on average to about 12 inches , often more. Fancy sorts ( rounded bodies, double or veil tails ect ) also grow very big. about 10 inches long on average ( again, often a lot more ) and they get about as round as an average orange or a tennis ball. Often bigger. The worlds largest goldfish was a whopping 17 inches long!!.
They also have a very long lifespan. 30 years+ if kept properly.
So you see, 5 gallons will stunt the fishes growth horrifically. Their bones stop growing, because there is no space in the tank for it to grow into , but the internal organs keep on growing until they have no more space left. This prevents them from working properly and is very painful. It's a bit like forcing a great dane puppy to grow into a crate made for a small terrier. Doesn't work.
Goldfish need a tank at least 4-5 feet long minimum , so about 55 gallons , preferably even more because they are so large, messy and active. They need a lot of strong filtration because they produce a LOT of waste. They really aren't any easier to keep than tropical fish when it comes to tanks and equipment.
The only thing you can put in your five gallon is 4 male guppies, 4 male endlers ( unless you want a population explosion ) shrimps, or a male betta. You cannot put any goldfish in it. That would be beyond cruel.
And to answer your question partly, there is no bottom feeding fish that will fit in a 5 gallon. You could have a couple of ghost shrimp though.