Samuel was a Mount Everest personality who appeared when the historical landscape was monotonously flat. As God's prophet, he judged the people. Since Israel was a theocracy (ruled by God), Samuel was virtually a king. He discharged his duties with skill and dedication to both God and the people.
But the people wanted a king such as the pagan nations around them had (1 Sam. 8:5). So they asked the man of God to step aside. Samuel was hurt by their rejection. He understood the scope of their disobedience (12:17-19).
The prophet could have turned his back on the new king and his rebellious people. Instead he declared, "Far be it from me that I should sin against the Lord in ceasing to pray for you" (v.23).
Why did Samuel say that? He knew that even as doors were being slammed in his face, another door was open to him--the door of intercessory prayer. Samuel demonstrated his godliness by the way he reacted. He was still God's man, and he would still care for God's people.
When we are snubbed by those we try to serve, we must resolve not to sin against the Lord by snubbing them in return. Instead, by God's grace, we can pray sincerely for those who may not value our best efforts. — Haddon W. Robinson
How deep does it wound you when others despise
Your labor of love? Don't despair—
It's then you must view them with Spirit-filled eyes
And love your offenders with prayer. —Gustafson
Pray for those who spitefully use you. —Jesus (Matthew 5:44)