First, a 2 & 1/2 gal. tank is way too small for breeding bettas in. You should use a 10 gal. and have individual tanks ready for when you remove the female and then the male from the breeding tank. The babies need a large tank all their own because you won't be able to change the water or do any cleaning in the baby tank for at least 2 weeks--and you'll have to be feeding them 2-3 times daily so things are going to build up fast (including fungus and bacteria). The bigger tank allows for you to start with only 3 or 4 inches of water during breeding, and then you can add clean water to the existing water a little each day once the adults have been taken out so after 2 weeks the 10 gal. is almost full. By then the babies will be big enough to transfer to a bigger tank.
Each of the adults will need their own tank since you can't keep them together when they are not breeding and both will need to recover from breeding. You'll need to keep all the bettas at a stead 80F degrees (babies will die if they get too cold). Adults will need to be fed meaty foods and will just need to be kept in clean water so you'll need to clean their tanks every other day. A 10 gal. tank is needed for breeding because the female will need space to run away to if the male gets too aggressive and she's not ready to breed yet. You also don't want to keep the male and female fish too close to each other while they are being conditioned prior to breeding because often they get too used to seeing the other one and no longer get eager to breed. The breeding pair needs to be conditioned for a minimum of 2 weeks prior to mating with high protein meaty food since you want healthy strong babies and you don't want your breeders dying during or right after mating because they aren't in prime health. Breeding is very stressful because the male usually won't eat for a week or 2 while he's minding his young. The female needs protein food to make healthy eggs. You need to set up the breeding tank first, then put the male in so he can explore it and claim it as his own, maybe even start blowing a bubblenest. Leave him in there for a few days. Then you slowly let him see the female (and let the female see him)--you sort of tease both of them with the other but you don't let them at each other. Once the female starts showing strips down her side (strips go from top to bottom) and she starts watching the male intensely, then she's ready to put in with the male. There should be places where she can hide if the male gets too aggressive, there should be room for them to chase around without hurting themselves and without overly disturbing the bubblenest. You also will need the extra room after breeding when the female swims to the other side of the tank since you'll need to net her out as quickly as possible without disturbing the male. Once the babies have all hatched and are swimming (not just sitting or crawling along the bottom), you remove the male. Don't breed your bettas until you do further research and get at least a 10 gal. tank for breeding and another 2 & 1/2 gal. tank for the other adult betta. You should also already have baby-size food ready before you put the adults in together since babies needs to be fed or they will die fast from starvation and the bigger ones will start eating the smaller ones. Do more research before you breed your fish unless you really don't care whether your fish (and any babies) live or die.