Jeremiah 7:16
Therefore pray not thou for this people, neither lift up cry nor prayer for them, neither make intercession to me: for I will not hear thee. Therefore pray not thou for this people, neither lift up cry nor prayer for them, neither make intercession to me: for I will not hear thee.
Jeremiah 7:16 belongs to a warning that Jerusalem and Judah would be destroyed and punished by Babylon as the swift avenger if the people did not turn from their sins, bringing the downfall of Judah as an independent nation. The warning was given because the people ignored the prophets' calls to turn back to God, rejecting His law and preferring human statutes despite the good statutes He had given them. Outward temple worship was declared to be of no avail to the ungodly.
The cause denounced was idolatry, the abominations of Topheth, treachery and shamelessness. The people made the temple and its worship their confidence of salvation while continuing in theft, murder, adultery, idolatry and oppression. This persisted though He had spoken to them early and often and they had not heard nor answered.
The verse is a specific command to Jeremiah not to pray, lift up cry, or make intercession for the people for their good, with the declaration that God would not hear him. That prohibition was given three times. Mercy was closed and judgment was fixed, so He would do to the house called by His name, wherein they trusted, as He did to Shiloh, and would cast them out of His sight as He cast out the whole seed of Ephraim.
It was spoken when Israel was going into Babylonian captivity, while Jeremiah was burdened for the sins of his people and the welfare of the holy temple. He wept over the desperate state of sin and was almost utterly discouraged by the utter lack of response to the messages God sent through him. Yet he still pleaded with God for the people and besought Him not to disgrace the throne of His glory. He saw hope in the prohibition itself as Moses did and kept on praying, because if God could destroy the people only if Jeremiah stopped praying, then his continued prayers could save them.
The verse is not a general prohibition against praying for others and should not be used to decide that anyone else is beyond hope or that prayer for that person must stop. When God gives someone a burden to pray for another, His Spirit helps in the effort to save that soul. When the burden is absent, it does not show that the soul is without hope, since God may have given the burden to someone else.