Is the soul both male and female?

The soul itself is neither male nor female. But when the soul at the start of its human journey takes a female body, then in all its future incarnations it will take a female body. If it first takes a male body, then in all its incarnations it will take a male body. It is nearly impossible to change the sex. In the whole history of mankind there have been a few exceptions here and there, but very rarely.