Genesis 48:7בראשית מ״ח:ז׳
I [do this because], when I was returning from Paddan, Rachel died, to my sorrow, while I was journeying in the land of Canaan, when still some distance short of Ephrath; and I buried her there on the road to Ephrath”—now Bethlehem.
Rashi on Genesis 48:7:3רש"י על בראשית מ״ח:ז׳:ג׳
ואקברה שם AND I BURIED HERE THERE and did not carry her even the short distance to Bethlehem to bring her into a city. I know that in your heart you feel some resentment against me. Know, however, that I buried her there by the command of God”. And the future proved that God had commanded him to do this in order that she might help her children when Nebuzaradan would take them into captivity. For when .they were passing along that road Rachel came forth from her grave and stood by her tomb weeping and beseeching mercy for them, as it is said, (Jeremiah 31:15) “A voice is heard in Rama, [the sound of weeping … Rachel weeping for her children]”, and the Holy One, blessed be He, replied to her (v. 16) “There is a reward for thy work, says the Lord etc. (v. 17) for thy children will return to their own border”. Onkelos translated it (כברת ארץ) by כרוב ארעא which is a full measure of one day’s ploughing. I am of opinion that they had a definite measure which they called “one full furrow”; old French cordié. So we say, (Bava Metzia 107a) “He ploughs (כריב) and ploughs again”, and (Yoma 43b) “as much earth as a fox carries on its feet from a ploughed field (בי כרבא).”
Jeremiah 31:15ירמיהו ל״א:ט״ו
Thus said GOD:A cry is heard in Ramah—Wailing, bitter weeping—Rachel weeping for her children.She refuses to be comfortedFor her children, who are gone.
Bereshit Rabbah 82:10בראשית רבה פ״ב:י׳
“Jacob established a monument upon her grave; it is the monument of Rachel's grave until today” (Genesis 35:20). “Jacob established a monument” – we learned there: The leftover [money] from the dead...Rabbi Natan says: With the leftover [money] from the dead one builds a structure on his grave. Rabbi Shimon ben Gamliel taught: One does not craft structures for the righteous; their words are their memorials. We learned that Israel was called by Rachel’s name, as it is stated: “Is Ephraim a dear son to me?” (Jeremiah 31:20). Another matter, “Rachel died, and was buried on the way to Efrat” – what did Jacob see that led him to bury Rachel on the way to Efrat? It is because Jacob foresaw that the exiles were destined to pass there. This is why he buried her there, so she would ask for mercy upon them. That is what is written: “A voice is heard in Rama, wailing, bitter weeping, Rachel weeping for her children” (Jeremiah 31:15).
Numbers 13:22במדבר י״ג:כ״ב
They went up into the Negeb and came to Hebron, where lived Ahiman, Sheshai, and Talmai, the Anakites.—Now Hebron was founded seven years before Zoan of Egypt.—
Rashi on Numbers 13:22:1רש"י על במדבר י״ג:כ״ב:א׳
ויבא עד חברון [AND THEY WENT UP BY THE SOUTH] AND HE CAME UNTO HEBRON — Caleb alone went there and prostrated himself on the graves of the Patriarchs, offering prayer that he might be helped not to give way to the enticement of his colleagues and join them in their counsel. You may see that it was Caleb who went there, for so indeed it (Scripture) states, (Deuteronomy 1:36) “[Save Caleb the son of Jephunnch, he shall see it] and unto him will I give the land upon which he hath trodden!” and it is written, (Judges 1:20) “And they gave Hebron unto Caleb” (Sotah 34b)
Sotah 34b:7סוטה ל״ד ב:ז׳
It is also stated with regard to the spies: “And they went up into the south, and he came to Hebron” (Numbers 13:22). Why is the phrase “and he came” written in the singular form? The verse should have said: And they came. Rava says: This teaches that Caleb separated himself from the counsel of the other spies and went and prostrated himself on the graves of the forefathers in Hebron. He said to them: My forefathers, pray for mercy for me so that I will be saved from the counsel of the spies.
Sotah 34b:7סוטה ל״ד ב:ז׳
It is also stated with regard to the spies: “And they went up into the south, and he came to Hebron” (Numbers 13:22). Why is the phrase “and he came” written in the singular form? The verse should have said: And they came. Rava says: This teaches that Caleb separated himself from the counsel of the other spies and went and prostrated himself on the graves of the forefathers in Hebron. He said to them: My forefathers, pray for mercy for me so that I will be saved from the counsel of the spies.
Sotah 34b:8סוטה ל״ד ב:ח׳
The Gemara explains: Joshua did not go to the graves of the forefathers because Moses had already prayed for mercy for him, as it is stated: “And Moses called Hoshea son of Nun Joshua [Yehoshua]” (Numbers 13:16), meaning: God will save you [Ya yoshiakha] from the counsel of the spies. And this is the meaning of that which is written: “But My servant Caleb, because he had another spirit with him, and has followed Me fully, him will I bring into the land where into he went” (Numbers 14:24), which implies that Caleb changed his mind over time. Joshua, however, was opposed to the intentions of the other spies from the outset.
Tosafot on Sotah 34b:7:1תוספות על סוטה ל״ד ב:ז׳:א׳
...
Taanit 16a:7תענית ט״ז א:ז׳
The Gemara further asks: And why do they go out to the cemetery on a fast day? Again, Rabbi Levi bar Ḥama and Rabbi Ḥanina disagree with regard to this matter. One said this is as though to say: We are like the dead before You. And one said that one goes out to the cemetery in order that the deceased will request mercy on our behalf. The Gemara asks: What is the practical difference between them? The Gemara answers that the practical difference between them concerns graves of gentiles. If the purpose of going to graves is to say that they stand before God like the dead, graves of gentiles would suffice. However, if they go to the cemetery for the deceased to ask for mercy on their behalf, they should visit specifically Jewish graves.
Tosafot on Taanit 16a:7:1תוספות על תענית ט״ז א:ז׳:א׳
...
Berakhot 18a:13ברכות י״ח א:י״ג
The Gemara relates that Rabbi Ḥiyya and Rabbi Yonatan were walking in a cemetery and the sky-blue string of Rabbi Yonatan’s ritual fringes was cast to the ground and dragging across the graves. Rabbi Ḥiyya said to him: Lift it, so the dead will not say: Tomorrow, when their day comes, they will come to be buried with us, and now they are insulting us.
Berakhot 18b:17ברכות י״ח ב:י״ז
In any case, with regard to the crux of the issue, Rabbi Yonatan also reconsidered his opinion, as Rabbi Shmuel bar Naḥmani said that Rabbi Yonatan said: From where is it derived that the dead converse with each other? As it is stated: “And the Lord said to him, this is the land that I swore to Abraham, Isaac and Jacob, saying: I will give it to your offspring” (Deuteronomy 34:4). What is the meaning of “saying”? It means that God told Moses: Go and tell Abraham, Isaac, and Jacob, that the oath that I swore to you I have already fulfilled for your descendants.
Deuteronomy 18:11דברים י״ח:י״א
one who casts spells, or one who consults ghosts or familiar spirits, or one who inquires of the dead.
Shulchan Arukh, Orach Chayim 581:4שולחן ערוך, אורח חיים תקפ״א:ד׳
One bathes and cuts their hair on the eve of Rosh Hashana. (and there are those that are accustomed to immerse in a mikvah on the eve of Rosh Hashana on account of seminal emission. And there are places where there is a custom to go to the graves and to pray very much there and to give charity to poor people there.)
Mishnah Berurah 581:27משנה ברורה תקפ״א:כ״ז
...