Having read Matt Ridley's "The Red Queen: Evolution of sex and co-operation", I understand that the origin of sex is a tough riddle that still needs to be solved. However,

1) Has it been possible to ascertain the exact time around which the sexes came into existence?

2) There has to be some intermediary stages of the formation of the male and female gametes. Have scientists been successful in finding these intermediary stages?

3) Is there a general consensus in the scientific community as to which theory best explains this conundrum?

4) Why hasn't there been a total shift from asexual to sexual reproduction?

Thanks in advance.

1) It is believed that sex first evolved around a billion years ago, this is possible to do by using gene sequencing to look at the the evolutionary rates of genes, and determin exactly how long genes from different species diverged from each other.

2) Yes it is believed that there would have been intermediate stages in the formation of male and female gametes. However imagine these would have been soft cells, nothing that would have been able to survive fossilisation. And I would highly doubt that any exisiting species would still use gametes without male and female specialisations as they are so clearly advantageous they would rapidly replace the unspecialised gametes as they give their owners a great advantage in fertilisation.

3)There are several theories, none of which seems to explain everything or has universal support. It may well be that it was a combination of different evolutionary pressures. And it is further complicated by the fact that the pressures which caused sex to evolve in the first place may not be those which keep it going today. It's a very hotly contended topic, and we may never have all the facts. The only thing we know for certain is that sex is very important. Otherwise is wouldn't be so universally widespread.

4) I don't know the exact answer to this. Although almost every species has at least some form of sex or gene exchange, including bacteria. Asexual reproduction does have some short term advantages in producing offspring quickly, and this may be beneficial to smaller organisms. Though it is probably of limited advantage in more complex organisms, where development and growth are much slower anyway. Some asexual species, which were once sexual have been found, though it is noteworthy that they are all 'young' species, and may end up going extinct without the benefits of sex.
The one stubborn example of asexuality is the bdelloid rotifer, which apparently has not had sex, despite being millions of years old. It is the mystery that every evolutionary biologist would love to solve!