You can only apply for an F-1 visa from an embassy abroad, so you'll have to leave the US at some point.
Please take care of your current visa situation. If you overstay your visa for more than 180 days, you are inadmissible to the US for 3 years. If you overstay for more than a year, you make yourself inadmissible for 10 years. And if you accrue several immigration infractions (e.g. overstaying one visa, getting a new one, overstaying that one too), you may make yourself permanently inadmissible.