In the Tanach, the word Yerushalayim is almost always written without a yud between the lamed and mem, but pronounced as if there is a patach under the lamed and a yud following it. We find though that Malki Tzedek was called Melech Shalem in Bereshis 14:18, and the midrash in Bereshis Rabba 56:10 implies that that is referring to Yerushalayim. This would seem to indicate that the city's name, at one point at least, was pronounced Yerushalem, as indeed it is vowelized in Aramaic, and that at a later period it was changed to Yerushalayim, as it indeed appears in Meggilas Esther. Did the switch occur, when, and why?
In the Chumash, we find "Malki-tzedek, king of Shalem", as well as Avraham referring to the place of Akeidat Yitzchak as "Hashem Yireh." The midrash says those names were combined, "Yireh+Shalem" -> "Yerushalayim."
Note that in Aramaic, it's pronounced "Yerushlame", which fits with how it's written Biblically -- no yud before the final mem. However in Hebrew, it's "Yerushalayim."