Well let's do this. I've never studied up on the evolution of sex so to make this interesting I'll give my guesses now then study up on the current scientific literature to see where I was wrong, right or N/A.
a)big question. I would say that along the line somewhere exchange of genetic material came about through a change in the genetic material. The upshot of this was stable given the adaptive environment. This delinated into male/female.
b) inherited from ancestors (since you specifically state human I'll keep my answers to us and not where the actual ability came about).
1) like male fish produce sperm we got it from our ancestors.
2) Mammalian trait since fish just spread it about in the water, we need an more liquid environment given the amniote. So we go this somewhere in the land/sea transition.
3) See fish (we inherited the trait from an earlier ancestor).
4) Adaptive change from earlier ancestor where single genetic material introduction with lock out was more successful.
5) Land based ancestor. See amniote.
6) From earlier adaption of any number of ancestors. (On a side note, I wouldn't call this exact as allah has killed billions of kids and mothers to be due to inexact timing over the history of mankind. Blind evolution makes this horrible suffering more understandable).
7) Inherited. It would seem reasonable to me that more complex creatures would be more successful should they be able to care and sustain their offspring.
The questions are a little poorly worded (no offense, that's why i wanted your answers to guide me). I'm sure you'll refine your questions as we proceed. My next responses will be mainly researched (I'll define where I'm giving my own opinions as I did in this case).
This sounds like it will be an interesting enterprise.
Thanks.
How does this happen, If you could answer, I'll give up:
I see 3 bricks lying on the floor, and I go somewhere, after a while, I see the 3 bricks standing to each other. I said "No one make the 3 bricks to stand to each other. Because, there is no 1st brick, bricks are made by themselves, making consclusion that behind every bricks there is a creator, is not intelligent enough."
Assalamu manit taba'al huda (May peace be upon who follow the guidance).