To get the context, we have to go back to Romans 9:10.
Romans 9:10-16 teaches us that Gods promises to Israel are based upon his election, not upon their obedience.
Gods sovereignty in such matters is stressed again in the two verses that follow. For the Scripture says to the Pharaoh, For this very purpose I have raised you up, that I may show My power in you, and that My name may be declared in all the earth. Therefore He has mercy on whom He wills, and whom He wills He hardens. (Romans 9:17-18) Here God declares that He not only has mercy on whoever He wills, He also hardens whoever He wills.
But this generates a potential problem. Men object to this doctrine because they imagine it would make God unfair. But Gods answer is not to explain why this is indeed fair. Instead, He simply says: You will say to me then, Why does He still find fault? For who has resisted His will? But indeed, O man, who are you to reply against God? Will the thing formed say to him who formed it, Why have you made me like this? Does not the potter have power over the clay, from the same lump to make one vessel for honor and another for dishonor? (Romans 9:19-21) God therefore does not defend this course of action on the basis of its fairness, even though it is fair, but on the basis of his right as the creator to do as He pleases.
So He continues in Romans 9:22-24:
What if God, wanting to show His wrath and to make His power known, endured with much longsuffering the vessels of wrath prepared for destruction, and that He might make known the riches of His glory on the vessels of mercy, which He had prepared beforehand for glory, even us whom He called, not of the Jews only, but also of the Gentiles?
Again, the point God is making is that He can do as He pleases. And He pleases to call not the Jews only, but also the Gentiles. This right of God to do as He pleases, and to choose whomsoever He wants to choose, is now illustrated by quotations from the Old Testament. The first of these are from Hosea, and are given in Romans 9:25-26.
As He says also in Hosea: I will call them My people, who were not My people, And her beloved, who was not beloved. And it shall come to pass in the place where it was said to them, You are not My people, There they shall be called sons of the living God.
The first part of this, I will call them My people, who were not My people, And her beloved, who was not beloved. is a quotation from Hosea 2:23, Where we read, Then I will sow her for Myself in the earth, And I will have mercy on her who had not obtained mercy; Then I will say to those who were not My people, You are My people! And they shall say, You are my God! The second part, And it shall come to pass in the place where it was said to them, You are not My people, There they shall be called sons of the living God. is a quotation from Hosea 1:10, where we read, Yet the number of the children of Israel Shall be as the sand of the sea, Which cannot be measured or numbered. And it shall come to pass In the place where it was said to them, You are not My people, There it shall be said to them, You are sons of the living God.
In both of these places, some might imagine that these passages refer to the church. But a close examination shows that this is cannot even possibly be their meaning. Looking at the last passage first, for it was first in the Order God gave them in Hosea, verses 1-9 of Hosea 1 detail Gods rejection of the house of Israel. (verse 8) Then we read the wonderful promise that, even though they were rejected, it shall come to pass In the place where it was said to them, You are not My people, There it shall be said to them, You are sons of the living God. This blessing, You are sons of the living God, was not to be said to someone else, but it shall be said to them. The very ones to whom God had said, Lo-ruhamah (not pitied) and Lo-ammi (not my people,) would be told, You are sons of the living God. But they would not only be told this, but they would be told this in the very place where they had been so cursed. This is concluded in the first verse of chapter 2. (We must remember that the chapter and verse divisions in our Bibles were added by man, there were no such divisions in the scriptures when God first gave them. And in some places the divisions actually break up what God was saying.) So God concluded this portion of his holy word by saying, Say to your brethren, My people, And to your sisters, Mercy is shown. (Hosea 2:1) To whom were these words to be said? To the church? No. They were to be said to your brethren. and to your sisters. Whose brethren and sisters were to be told My people, and Mercy is shown.? The very ones to whom it was said Lo-ruhamah and Lo-ammi. These were unquestionably the sinning house of Israel. No scripture anywhere even suggests the idea that either the church or its individual members are the brethren and sisters of the house of Israel.
We find the same thing again in the next portion of Hosea, where God first pronounces his divorce and judgment of guilty Israel; (Hosea 2:2-13) but then, just as in the first chapter, He continues by promising their eventual restoration. (Hosea 2:14-23) Even as He had just pronounced his divorce and judgment, He now promises his betrothal and blessing of the children of that same guilty nation which He had divorced. For even as He had said in verse 2, Bring charges against your mother, bring charges; For she is not My wife, nor am I her Husband, He now repeatedly tells them, I will betroth you to Me, (verses 19 and 20) and says you will call Me My Husband. (verse 16) God had called the one He had divorced, your mother, but He now calls the ones He will marry, you. This, then, is the context of verse 23, where we read, Then I will sow her for Myself in the earth, And I will have mercy on her who had not obtained mercy; Then I will say to those who were not My people, You are My people! And they shall say, You are my God!