Both are worded in the form of a question without the correct puctuation.
While the more formal old school "To which group do I belong" is a good way to form the sentence if it is truly a question, but the informal "Which group do I belong to" is much more common, though some might argue is not technically good form. In short, my suggestion is that you are using too many words, but I will also correct the above examples.
- I don't know which group I belong to.
- I don't know to which group I belong.
I simply removed the word 'do', from both.