The third sentence is certainly the worst of the three, but I don't like any of them. Here are some suggested alternatives:
I didn't know if I was going to work next week.
Better: I didn't know if I would be working next week. This comes from putting the following sentence into the past: I don't know if I will be working next week.
I didn't know if I was to work next week.
Better: I didn't know if I was supposed to work next week.
I didn't know If I were to work next week.
You can use the subjunctive if you rewrite this, for example I didn't know if she were expected to work next week. But most people wouldn't use the subjunctive in a situation like this anymore.