Hello Maurice and Meghan,
This is not an odd behavior at all.. i have three rainbow sharks, well two and a redtail, and this is very typical of them. They are fairly territorial fish, and tend to find a small nook to call their own. One of mine even moved some "plants" to create a secure place. I assume yours is pretty young being in a 5 gallon tank, but it will probably consider the entire tank it's "territory" and I guess the spot under the filter as it's "bed". I also think they like that spot because the undertoe keeps them in place. I have noticed certain fish can bring life to your rainbow but what kind is up to your sharks personality. At least that's what i've seen. For example, my more timid albino rainbow is with a school of lyretail mollies and they swim around constantly, it seems to make the rainbow feel more safe about swimming around. My more aggressive Redtail is alone with a jack dempsey, which surprising turned out great. The red tail flares up and tries to show his dominance making him look his best but they leave each other physically alone. My third is with zebra danio's and their quick surface swimming seem to calm him. So maybe certain tank mates will help, but when they don't you end up with 6 tanks and growing like me

. Giving it a ship or something just big enough for it might lead to a more comfortable home and a easier goin fish.
Good Luck
_AB_