The other day, I was using E. coli for an experiment, and I was explaining to my research colleague (a gynecologist) that the cells we were using are male. Male bacteria make "sex pili" which they use to puncture the female bacteria and insert DNA. If the inserted DNA contains all the genes for the sex pili, the donor becomes female and the recipient becomes male. Yeast are not classified as male or female, but as "alpha" and "A" mating types. They mate by fusing into diploid cells, although S. cerevisiae (bread/beer and also lab yeast) seem to have a preference for the haploid state.
To make a long story short, sexual reproduction seems to have been around pre-multicellular organisms.
That’s fascinating!