The teacher asked me what I was doing.
(here, 'said to me' changes to 'asked me' as the teacher is asking a question. 'You' becomes 'I' and 'are' changes to 'was'. Another thing to note is that, the changed form of 'you' and 'are' exchange their places. There is no question mark as it is being reported by someone.)