I recently resigned from a US company and moved back to India on 5/31/2019 (I was on my H1b). I submitted my resignation letter already. I will be going back to school for a Ph.D. in the fall and my VISA interview is scheduled for 06/24/2019.
In the meantime, I found a new opportunity to work for a different US company as an independent consultant while I am in India. Is this legal for me to do so? How do I handle my taxes in that case ? I pass the US IRS's substantial presence test so I am a US tax resident. Should I ask the company to withhold my taxes?