"What are you writing?"
"What are you writing?" is not equal to "What do you write?" The first can refer to the book that you are writing little by little over the course of 15 years. The second refers to me writing this very words right now, in order to explain the issue if the "IN".
If we can agree on that, then let's continue with the given frase: "What are you writing"? Our example verb is "to write".
In Chinese, you would say: What are you IN (THE PROCESS OF) to write? Or, word by word: What are you IN to write?
They can not add an "ing", to have "writing", or rather "写ing". So the workaround is to ad "在"/"IN", to indicate that you are IN THE PROCESS of writing.
Hope that helps.