You need to do a large water change (like 60% everyday the next few days, if not 1 100% change right now (if you do 100%, make sure you reacclimate your fish SLOWLY... get water the same temperature by floating for 15 minutes, after that, take some water out of the container he's floating in, add some tank water to the container, wait 5 minutes, take some water out, add some tank water, wait 5 minutes, release)... Make sure the water is dechlorinated.
I'm fairly certain the problem is water quality. You can only keep 1 betta in a 5 gallon, no tank mates (except shrimp and snails)... I'm sorry the pet store misdirected you. :( And, if your tank is establishing a cycle, you have to do more than one 40% change per week in a 5 gallon. I had to do at least 2, usually 3 50% changes a week when my 5 gallon was cycling to keep ammonia down, vacuuming substrate 1x per week.
... Since he's laying on the bottom, you may want to lower the water level so he can get to the surface more easily.
What I'd do: Net him, put him in a (well-rinsed and rubbed in hot water, then cold water) container/cup of tank water. Do 100% change on tank... Don't clean the filter, just clean the gravel and the tank. Re-fill the tank with clean, dechlorinated tap water of about 80 degrees (USE THERMOMETER). Float betta's container in the tank to get temperature equal, and acclimate him like I said above. If after a few hours, he's still laying on the bottom, float him in the tank in the aforementioned container in CLEAN water... duct tape it to the side (don't get any duct tape in the water). Feel free to float him in 1 tsp/gallon pure (no fragrances) epsom salt. Mix it up in a 1 gallon drinking water jug until it's all dissolved. Again, don't forget dechlorinator. While he's floating in the tank, you HAVE TO CHANGE that water once a day. I use two containers when I do this... have 2 duct taped in the tank, one with clean water, one that the fish is in... Everyday, move the fish to the other container, clean the container he was in, add water, duct tape back to the wall of the tank.