Which sentence is correct:
1. I thought you WERE WORKING in the office this week. (correct)
Here, you are using the past continuous tense to describe an "uninterrupted" event taking place over a duration in the past. For example, it is now Saturday, and you thought someone was working earlier in the week from Monday to Wednesday.
2. I thought you HAD WORKED in the office this week. (correct as well)
The past perfect tense is used to talk about something that happened (an earlier event) before something else (a more recent event) in the past. For example, it is now Monday. Last Friday, you thought of your friend and believed that he had done his work last Monday.
I hope this helps.