Fruit flies breed by having sexual intercourse. After the fruit flies have become mature enough to be sexually active, which is actually just two days after they have reached maturity, they will have intercourse and then the female will lay her fertilized eggs. They like to lay their eggs on soft mushy decay fruit or other decaying food.
The fertilized eggs only take 24 to 30 hours to hatch and then the fruit fly begins its life as a maggot. They go through a process before becoming a fully mature fly and then only two days after reaching maturity they become sexually active and start the process all over again.