Questions & Answers about Wir haben dasselbe Problem.
In standard German, dasselbe is normally written as one word when it means the same.
- dasselbe Problem = the same problem
- dieselbe Idee = the same idea
This is a fixed form built from der/die/das + selbe.
You may sometimes see separate writing in older texts or in very specific stylistic situations, but for learners, the correct form to use here is dasselbe.
This is one of the most common questions.
- dasselbe means one and the same
- das gleiche means an identical/similar one
So:
Wir haben dasselbe Problem.
= We both have the very same problem.Wir haben das gleiche Problem.
= We have the same kind of problem / an identical problem.
In everyday speech, many native speakers use them quite loosely, and das gleiche is very common where strict logic would prefer dasselbe. But the traditional distinction is still useful to know.