Das ist es, was wir in der Welt ändern müssen.
What does was refer to: das or es? And why?
This is actually an interesting question, because the test of @jonathan.scholbach's and my choice, the replacement test, yields opposite results!
In the following, I will use as a replacer die Langeweile, simply because @jonathan.scholbach used it, too.
When I read the question for the first time, I thought to replace das. The result is as follows:
DasDie Langeweile ist es, wasdie wir in der Welt ändern müssen.
Conclusion: The relative pronoun die refers to die Langeweile. By analogy, the relative pronoun was should refer to das.
User @jonathan.scholbach chose to replace es, and got the following result:
esdie Langeweile, wasdie wir in der Welt ändern müssen.
Conclusion: The relative pronoun die refers to die Langeweile. By analogy, the relative pronoun was should refer to es.
We get opposite results depending on what is replaced (das versus es). Therefore, either the replacement test is not appropriate to figure out which is the one antecedent of the relative pronoun, or—this is the interpretation that I prefer—both are the antecendents of the relative pronoun.
Since the given sentence lacks context, which leaves open what das refers to, I will use the following example with a noun phrase subject. I use (es) to indicate that the sentence is fine with or without es. The meaning of the sentence is not affected by its presence or absence.
Eine gutwillige, achtungsvolle Haltung – das ist (es), was der Anstand von uns fordert. (Haluschka)
I propose analysing the clause starting with was as a free relative clause. This is a term from traditional grammar that is a bit misleading in that it suggests that free relative clauses are a special kind of relative clause. However, they behave completely differently.
Formally, free relative clauses do not have an antecedent and serve as the argument of a verb, for instance as a subject or object clause.
Semantically, free relative clauses introduce new referents, similar to the way definite noun phrases do.
Let's look at some English examples, with the direct object marked in bold.
He took back his words. (noun phrase as object)
He took back the words he said. (with a "regular" relative clause)
He took back what he had said. (free relative clause as object)
Observe how the free relative clause replaces a noun phrase, functions as a direct object and introduces a new referent, i.e. "the things he had said".
Just like German, English allows the sentence in 3. to be modified as follows:
- He took back that which he had said.
This sentence is synonymous with 3. It cannot be parallel to 2., as that in 4. does not introduce a referent and cannot stand alone:
*He took back that.
(Note that he took that back is obviously grammatical, but completely different: in this instance, that refers back to something that has been introduced earlier, which it does not do in 4.)
One can therefore either group 4. with 3., or treat it as a construction sui generis. I prefer the former, even if that stands in conflict with the traditional definition of a free relative clause in that the relative pronoun which being connected to the pronoun that.
Now let's move back to German and the modified example sentence.
Eine gutwillige, achtungsvolle Haltung ist (es), was der Anstand von uns fordert.
If es is missing, the bolded clause is a free relative clause functioning as the subject complement of sein.
If es is present, it has no referential value: neither does it refer back to anything mentioned previously, nor does it introduce anything new. I suggest thinking of it as a Korrelat: a word that simply announces that an argument clause is following, in this case a free relative clause.
Using the same analysis on the original sentence
Das ist (es), was wir in der Welt ändern müssen.
we get the following meaning
That (which was mentioned previously) has the property of being the thing that we need to change in the world.
with the thing that being the meaning contributed by the free relative clause, or specifically the (es) was: the introduction of a new referent.
We can answer this by making a replacement test:
Das ist die Langeweile, die wir in der Welt ändern müssen.
Here we can clearly see, that the relative pronoun changes gender in accordance with Langeweile and not with das, indicating that Langeweile is the antecendent of the pronoun.
If we take this back to your sentence, this leads us to say, that grammatically, the antecendent of the relative pronoun in your sentence is es. The referents of das and es however are the same.
But also see the answer of Björn which proves me wrong by showing that my analysis is simply incomplete.
Note the "es" in your sentence is completely optional and can be omitted without changing the meaning, as in
Das ist, was wir in der Welt ändern müssen.
In the above, it is obvious that "was" refers to "das" (there's nothing else to refer to). Why should the reference change when something optional ("es") is added?