One doesn’t pronounce יהו-ה, but with so many titles to be found in the Tenach for referring to יהו-ה, why would we refer to Him as ‘HaShem’ then? Why not stick with Adonai, Anochi, El Shadai etc. like our forefathers did? (Or in case you want to refer to it more directly use Yud-Hey-Vav-Hey?) What I would like to know is how and when people came up to use the title ‘HaShem’, who came up with it or what is the oldest source known to us teaching us the usage of ‘HaShem’ as a reference to יהו-ה?
Shalom, Thank you for your question. Within the limits of this internet question and answer service, let me try to begin to address your question – which really deserves a long article after intense research. It is forbidden to pronounce the holy name of G-d as it is written. This name was pronounced in Temple times by the High Priest on Yom Kippur in the holy of hollies. However, apart from this the holy name is never pronounced as writen. Therefor we pronounce the name as “Adon-ai” when we turn to G-d in prayer, or are directly referring to Him. There exists a very serious sin of taking G-d's name in vain, which is extended to any use of the name without the correct reverence – as the Rambam says - “It is not only a false oath that is forbidden. Instead, it is forbidden to mention even one of the names designated for G-d in vain, although one does not take an oath. For the verse commands us, saying: “To fear the glorious and awesome name.”Included in fearing it is not to mention it in vain. Therefore if because of a slip of the tongue, one mentions [G-d’s] name in vain, he should immediately hurry to praise, glorify and venerate it, so that it will not have been mentioned in vain. What is implied? If he mentions G-d’s name, he should say: “Blessed be He for all eternity,” “He is great and exceedingly praiseworthy,” or the like, so that it will not have been [mentioned entirely] in vain." (Mishneh Torah, Laws of Oaths 12:11. ) Therefore, out of fear of holiness of G-d's name, the custom is not to pronounce any of the holy names of G-d out of the framework of prayer (and a few other situations, such as learning Torah etc) So we use a word that does not have any holiness – such as “HaShem” = The Name. I am not sure when and where the use of Hashem came into use. Already in the Torah there is talk of “the name” of G-d (see Leviticus 24, 11) – but this is not as a replacement to saying G-d's name, but rather referring to the fact that G-d's name was cursed. However in the Mishna there is mention of Hashem replacing the use of Adon-ai. See for example the Mishna in tractate Yoma, chapter 3 mishna 8. There the Mishna is talking about the service of the High Priest on Yom Kippur, and describes that he would say “Ana Hashem” (“Please of Lord”). The Mishna writes the word “Hashem” even though we know that the Priest would not say Hashem but use G-d's name. The commentator on the Mishna, the Tosafot Yom Tov, writes that the author of the mishna did not want to write the real name of G-d (which is what was pronounced in the Temple service) but rather wrote “Hashem” as a replacement. This is the usage also found in the Yom Kippur prayers we say today in our Yom Kippur service. Based on this we can say that the usage of Hashem in place of saying Adon-ai existed already at the time of the Mishna (3rd century of the common era). I hope this is of some help to you. (My thanks to Rabbi Apple for his help in this answer). Blessings.