I have a 22 gallon (100 litre) fish tank with 8 male guppies. I would like to add some betta fish, female or male, but I’m unsure if them two types of fish are ok to stay together or how many betta fish can be put into the 100 litre tank if I put my guppies into a smaller tank
You can have as may as you want, but not in the same aquarium. Two (or more) male betta's in one aquarium will surely find each other and fight to death. Just consider this: a male betta is always ready to even fight his own reflection in a mirror!!
Some sites claim that even betta females might have aggressive behavior, especially while they are having babies. That is why it is recommended to separate betta mothers to be alone in their own volume of water.
A betta male and a betta female can also become aggressive to each other, while they are together for mating. This is why in this case the aquarium needs to have a lot of hiding places for the female (plants, wood...).
The guppies will be fine, UNTIL the betta male will have a moment of confusion and will think that the guppies are also betta males (because of their large fins). That when the guppy family will start losing numbers.
Occasionally, male bettas will shows some signs of aggression towards "any" kind of fish - but this is related to the individual personality. Possible other causes would be boredom, or the male being ready to have a mate.
Betta males will usually not be aggressive to bottom dwellers, simply because they do not meet. Betta spends his life at the top of the water, while the bottom dwellers to the ... bottom (doh!).
Other than this, good luck with your decisions ;)
Only one male betta fish per tank! And I do not recommend putting bettas with guppies as they may nip each other's fins or get aggressive. As for female bettas, sometimes they are fine together, but sometimes they may fight and kill each other or get stressed. Not to say it hasn't successfully been done, but it may not be the best choice. Also, putting a male and a female betta together is possible, but you will need a larger tank and some experience at fishkeeping (which you very well may have, just something to consider.)
Overall, I recommend a different tankmate for your guppies, like tetras, danios, rasboras, or catfish. I hope this helps!
Thanks for your comment Allerleilurah! But please note that the point of these answers is so that the author can have a helpful, to-the-point summary of the requested information. The articles are good to have to back up your point if you are questioned, but they only have to be read through "if you want". They are not crucial to read. :) Thanks for understanding!
Two or more male bettas is not a good idea; similarly, male betta and male guppies together can also be slightly problematic (as they both are colourful and have longish fins). I found the reproduction rate of guppies to be quite overwhelming at times, so I would expect some losses, but not a complete eradication of guppy population by the betta.
I advise you not to let them live together. Because male guppies are brightly colored ones with flowing tails. Both cause aggression and territorial instincts in bettas. Putting a male guppies and male bettas together will cause spelling trouble and most likely lead to the death of your guppies. So it's better to keep them separate. And if your size is 22 gallons then I think you can keep 4-5 betta fish is perfectly suitable.