I've cycled two tanks (a 29 and a 5 gallon) with the raw shrimp. If you are cycling a betta tank, depending on the size, you won't need too much shrimp. I used about a half inch worth of a medium sized shrimp. Leave it in until the cycle is complete--it will continue to provide ammonia, which will continue the cycle (bacteria eat the ammonia, create the nitrites, providing the food for the second type of bacteria). The cycle can take up to 6 weeks so have patience. Eventually the ammonia will drop to zero and the nitrites (which can take the longest) will drop to zero almost overnight. That's when the cycle is complete. You can then do the water change (just the water) and add your fish.
I kept my piece of shrimp in a bit of pantyhose and if it becomes "furry" on the outside I just did a small water change, enough to use the siphon to get the furry stuff off the outside. It never came back. Hope this helps.