Praise be to Allah
What we advise you to do in this situation is to show the results of these examinations and tests to trustworthy doctors. If you do that, and the doctors think that the male characteristics are more prevalent in you, then there is nothing wrong, in that case, with undergoing the necessary surgery to correct the situation and enhance your real gender. It says in a statement by the Islamic Fiqh Council that is connected to the Muslim World League, in the sixth statement issued in 1409 AH at its eleventh session:
“With regard to one who has in his physical makeup both male and female characteristics, we should see which is prevalent in his case. If masculine characteristics are prevalent, then it is permissible to treat him medically in order to remove any ambiguity about his masculinity. If feminine characteristics are prevalent, then it is permissible to treat her medically in order to remove any ambiguity about her femininity. That may be done whether the treatment is by means of surgery or hormone therapy, because this is a disease, and the purpose of treatment is to heal disease, not to change the creation of Allah, may He be glorified and exalted. End quote.
What you must do is hasten to deal with it and make your family understand the seriousness of the issue, and the seriousness of continuing to mix with non-mahram females in particular, especially in this situation when you have masculine inclinations and desires. It is not permissible for you to see anything of women’s ‘awrahs, or to be alone with non-mahram women, or to be alone with non-mahram men, because you may also be a temptation to them, until your treatment is complete and the doctors have determined your real nature..
In al-Iqnaa‘ fi Hill Alfaaz Abi Shujaa‘ (2/407) it says: With regard to an intersex person whose case is ambiguous or unclear, he should be treated with extreme caution, and be regarded as a man with regard to women, and as a woman with regard to men, so it is not permissible for any non-mahram man or woman to be alone with this individual. End quote.
See also the answer to question no. 164232
And Allah knows best.