No, you can’t put a rainbow shark in a 10-gallon tank. Rainbow sharks need plenty of swimming space to thrive. A 50-gallon tank is the minimum size for keeping a rainbow shark.
If placed in a smaller tank, the rainbow shark will become aggressive and get stressed or sick after a while. Rainbow sharks are naturally very territorial, so they need plenty of space to feel comfortable.
Additionally, a rainbow shark also needs plenty of horizontal space to swim around, so you should get a long tank as opposed to a tall one. Ideally, the tank must be at least four feet long and 18 inches wide. If you decide to keep other fish or aquatic creatures as well, make sure to get an even bigger tank.