Paul was unequivocal: God has not rejected Israel.
Romans 11:1 I ask, then, has God rejected his own people, the nation of Israel? Of course not! I myself am an Israelite, a descendant of Abraham and a member of the tribe of Benjamin.
But why did he even need to explain it to a church full of Jewish and Gentile believers?
One suggestion is that the early Roman church had lost its Jewish believers when the Roman emperor Claudius expelled them from Rome:
Acts 18:1-2 … when Claudius Caesar deported all Jews from Rome.
The word ‘all’ here is hyperbole: it’s not likely that the populist Claudius would have wanted to or been able to expel Roman citizens or slaves who happened to also be Jewish. Expelling Jewish believers from Rome would be consistent with Claudius’ record of threatening people in other cities with expulsion if unrest continued. It doesn’t mean the Jewish converts were violent or riotous, but that they were seen as the trigger for social unrest (in much the same way that Paul was removed from certain cities when others rioted because of the gospel).
Other ancient manuscripts also provide evidence of the expulsion and the possible causes: riots (or unrest) in the Jewish population in Rome. Claudius died in 54AD, his edict died with him, and it’s believed that the Jews could then return to Rome.
Paul’s letter to the Romans is believed to have been written in this context: the Jewish believers had returned to a Roman church now run by Gentiles with no connection to Jewish traditions.
This explains Paul’s olive tree metaphor: the grafted branches (the Gentiles) couldn’t reject the rootstock they’d been grafted in to (Israel and the Jews), because a branch can’t survive by itself. It led to this stern warning:
Romans 11:23-24 And if the people of Israel turn from their unbelief, they will be grafted in again, for God has the power to graft them back into the tree. You [Gentiles], by nature, were a branch cut from a wild olive tree. So if God was willing to do something contrary to nature by grafting you into his cultivated tree, he will be far more eager to graft the original branches back into the tree where they belong.