Jeremiah 31 is one of my favorite in Tanach. In very poetic language, the chapter describes God's love for his people and the future redemption of the Israelite nation. I wrote a bit about this chapter in an answer to a different question here.
The subject of this chapter is unambigiously "Ephraim," one of the twelve tribes of Israel:
There will be a day when watchmen cry out on the hills of Ephraim, ‘Come, let us go up to Zion, to the Lord our God.’” (31:6 NIV)
See, I will bring them from the land of the north and gather them from the ends of the earth. ...I will lead them beside streams of water on a level path where they will not stumble, because I am Israel’s father, and Ephraim is my firstborn son. (8-9)
I have surely heard Ephraim’s moaning: ‘You disciplined me like an unruly calf, and I have been disciplined. Restore me, and I will return, because you are the Lord my God. (18)
“A voice is heard in Ramah [should be translated: a voice is heard on high], mourning and great weeping, Rachel weeping for her children and refusing to be comforted, because they are no more.” (15)
Rachel, one of Jacob's wives, is the grandmother of Ephraim.
In general, Ephraim is used as a synecdoche to refer to the whole Northern Kingdom of Israel. The tribe of Ephraim inhabited the northern part of Israel. Jeroboam, the first king of the Northern Kingdom was from the tribe of Ephraim and the later prophets often refer to the Northern Kingdom by the name Ephraim (eg: most of the prophecies in Hoshea are addressed to Ephraim).
Jeremiah functions as a prophet until after the destruction of the Southern Kingdom around the year 586 BCE which means he was born well after the northern kingdom of Israel was destroyed and exiled in the year 722 BCE (136 years earlier). So why is Jeremiah suddenly addressing himself to Ephraim? What is the signficance of this chapter? Is there an implicit message that the Southern Kingdom is supposed to take from this?