It's forbidden for non-mahram men and women to be alone together (khulwah). However, the question is if being alone in a taxi constitutes khulwah given that people can see inside taxis. There's a difference of opinion (see below).
SeekersHub (Hanafi) write:
As a taxi driver, it is permissible for you to take a female customer, based on the following considerations. It would not entail seclusion (khalwa) that is forbidden, as long as the streets taken have people there that can easily see inside the cab. Avoid secluded streets, and avoid doing so at night.
(See also Qibla.com from IslamQA.org.)
Islam Q&A (Salafi) write:
A taxi driver is bound to pass through empty streets or highways, and the structure of the car conceals most of the body of a person riding in it. Furthermore, there is no guarantee that a forbidden conversation will not take place, or that there will not be an agreement to do something forbidden. ... A taxi driver should not accept a female passenger who is alone, except in cases of emergency such as accidents and the like.
(See also another Islam Q&A fatwa.)
Shaikh Muhammad Naasirud-Deen al-Albaanee (Salafi) writes:
A woman riding alone with a taxi driver that is not a mahram to her may encounter herself in privacy (khulwah) in the sense that some of the forbidden matters that occur normally in khulwah (privacy), are likely to occur in such a situation. Furthermore, there is no third person that is with them. But from here, I do not hold that it is khulwah (privacy), but instead it is a motive and an incentive for fitnah (temptation). And this fitnah is not found in the other example in which there is another woman present or another man. Indeed the occurrence of fitnah in this situation is less likely than in the first situation. [Al-Asaalah, Issue #10]
(Sourced from TheClearPath.com)
Al-Islam (Shia) write:
If there is no intention of having pleasure or excitement and there is no chance of falling into corruption, then the act of sitting in itself is not a problem.