2 Samuel 15:12 "And Absalom sent for Ahithophel the Gilonite, David's counsellor, from his city, from Giloh, as he offered the sacrifices. And the conspiracy was strong, and the people with Absalom were steadily increasing."
The "friend" who betrays King David, that is mentioned in Psalms 41:10 (41:9 in Christian Bibles), and Psalms 55:14-15 (13-14, in Christian Bibles), is Ahithophel. He joined Absalom in revolt against King David (Absalom's father).
(It would not be Jonathan, because Jonathan was always loyal to David.)
The Talmud in Tractate Sanhedrin (106b - 107a) says that Ahitophel is the same one mentioned in both Psalms.
חצו ימיהם תניא נמי הכי אנשי דמים ומרמה לא יחצו ימיהם כל שנותיו של דואג לא היו אלא שלשים וארבע ושל אחיתופל אינן אלא שלשים ושלש
And Rabbi Yoḥanan says: Doeg and Ahithophel did not reach half of their allotted days, as they died before the age of thirty-five, half of the standard lifetime mentioned in the verse: “The days of our years are seventy years” (Psalms 90:10). This is also taught in a baraita: “Bloody and deceitful men shall not live half their days” (Psalms 55:24); all the years of Doeg were only thirty-four, and the years of Ahithophel were only thirty-three.
וא"ר יוחנן בתחלה קרא דוד לאחיתופל רבו ולבסוף קראו חבירו ולבסוף קראו תלמידו בתחילה קראו רבו (תהלים נה, יד) ואתה אנוש כערכי אלופי ומיודעי ולבסוף קראו חבירו (תהלים נה, טו) אשר יחדו נמתיק סוד בבית אלהים נהלך ברגש ולבסוף קראו תלמידו (תהלים מא, י) גם איש שלומי אשר בטחתי בו
And Rabbi Yoḥanan says: Initially, David called Ahithophel his teacher, and eventually, he called him his colleague, and ultimately, he called him his student. Initially, David called Ahithophel his teacher, as it is stated: “But it was you, a man my equal, my master [alufi], and my familiar friend” (Psalms 55:14); a teacher is known as aluf as he trains [me’alef ] his students. And eventually, he called him his colleague, as it is stated: “We took sweet counsel together, and walked to the house of G-d with the throng” (Psalms 55:15); the term together indicates that they were equals. And ultimately, he called him his student, as it is stated: “Even my own familiar friend, in whom I trusted,
אוכל לחמי הגדיל עלי עקב
who did eat of my bread, has lifted his heel against me” (Psalms 41:10). (Bread is a metaphor for Torah knowledge.)