Ok, lots of debates about keeping male and female bettas together in the same tank. Generally, male bettas are too aggressive to keep with other bettas (of either sex) unless they are breeding together--and then you only leave the female in with the male until she finishes releasing her eggs (then remove her or the male may kill her trying to protect his brood). There are some males that are so congenial, or disinterested, they can be with other bettas. A fish (male or female) who seems to be mellow and non-aggressive in a solo tank or in an all-female tank may become VERY aggressive when put with the oopposite sex. And although the males are thought to be aggressive, I've had several females who are just as nasty as males are and had to be kept solo--they'd even try to tear up any male I tried to breed them with.
Another factor is that although a male and female in the same tank may at first cohabitate nicely, attitudes can change real fast--one may decide he or she does suddenly want to breed and if the other is not willing (or ready), you can end up with a mutilated or dead fish. I've had females who are ready to breed but the male wasn't quite ready and she was literally tearing him apart trying to get him to cooperate--had to remove her before she damaged him beyong repair (she was going for his lips--bettas will sometimes aim for their opponent's lips to tear them off). Or they both may suddenly decide that they'd rather be lovers then just platonic friends and you'll come home to a tank full of eggs and a male trying to protect them (attacking or killing the mother) and you'll have to either kill the eggs before they hatch (24-72 hours after fertlization) or have to be prepared with baby betta food.
If you must put male and females together: provide LOTS of hiding places, lots of plants; get a tank big enough so none of hte fish feels crowded and don't overstock the tank; don't put too many females in with a male because they may form girl gang and kill him; 2 females will keep him busy and tired enough so the females don't get over-stressed; keep a close eye on them always because the dynamics can easily change very fast.
Most females can be kept together provided the tank is big enough. They will flare at each other, chase each other, even nip because bettas always have to establish and maintain a pecking order, even the females. Some get territorial (I have one who has staked out the sponge filter as her private paradise and chases everyone else away). But in general they will coexist and live happily together although there are always some females who are too aggressive to keep communally.