The scriptural foundation is laid in Vayikra 23:24, which commands Israel to observe the first day of the seventh month as a day of rest commemorated with a תְּרוּעָה — a loud blast — and the Gemara in Rosh Hashanah 16a anchors that blast to the themes of Kingship, Remembrance, and Shofar, explaining that Israel sounds the shofar so that their remembrance rises before God for good, and specifically uses a ram's horn to evoke the Akeidah of Yitzchak.
The cosmic stakes of that day are laid out in the Gemara in Rosh Hashanah 16b, which records in the name of Rabbi Yochanan that three books are opened on Rosh Hashanah — one for the wholly righteous, sealed immediately for life; one for the wholly wicked, sealed immediately for death; and one for the middling, who remain suspended until Yom Kippur, and Mishneh Torah, Repentance 3:3 codifies this teaching, adding that just as a person's merits and sins are weighed at the moment of death, so too are they weighed each year on Rosh Hashanah.
It is against precisely this backdrop of open books and suspended judgment that Mishneh Torah, Repentance 3:4 reads the shofar blast as a hint — a רֶמֶז — calling out: "Awaken, O sleepers, from your sleep; arise, O slumberers, from your slumber; examine your deeds and return in repentance, and remember your Creator" — addressing those who have forgotten the truth in the vanities of time and wandered through the year in emptiness, urging them to look into their souls and abandon each one his evil path and his unwholesome thought.
Sefer HaChinukh 405:2 draws out this arousal function explicitly, teaching that every person must stir his nature to seek mercy for his sins from the Master of Mercy, and that the sound of the shofar greatly awakens the heart of all who hear it — particularly the broken sound of the teruah — citing the Rambam's formulation directly, while Sefer HaChinukh 311:3 adds that since Rosh Hashanah is the day of judgment for all living things it is fitting to stand in fear and trembling, and that the teruah — a broken sound — hints that each person must break the power of his evil inclination and regret his evil deeds.
Pesikta Rabbati 40 situates the shofar within the larger arc of the Ten Days of Repentance, recording that God says: "On Rosh Hashanah I judge My world, and on that very day I could conclude the judgment — yet why do I suspend it for ten days? So that they will do teshuvah" — and the ten shofar-verses of Malkhiyot, Zikhronot, and Shofarot correspond to those ten days of repentance.
Beit Yosef, Orach Chayim 581 articulates why the shofar is especially suited to this arousal: the verse in Amos — "If a shofar is sounded in the city, will the people not tremble?" — teaches that the sound of the shofar itself causes a person to be seized with awe of God and His majestic splendor, and through it a person is stirred to return in teshuvah, while Arukh HaShulchan, Orach Chayim 581 confirms that the shofar is particularly conducive to teshuvah on these grounds, and accordingly all Israel adopted the custom of sounding the shofar throughout the month of Elul before the days of judgment.
Sefat Emet, Devarim, Shabbat Shuva 21:4 reaches deeper into the nature of this arousal, teaching that the shofar-blast on Rosh Hashanah awakens that very voice Israel heard at Sinai — "Anokhi" — and is the voice of the Beloved knocking to rouse the heart to teshuvah, even when one is asleep in the fulfilment of mitzvot, for while sin extinguishes a mitzvah it cannot extinguish Torah.
Maamar HaChochmah, Chelek 1 6:6 frames the shofar eschatologically, teaching that the first great strengthening of the good came through the shofar of Matan Torah, and its final completion will come through the great shofar of the future — and Israel is therefore commanded to sound the shofar on Rosh Hashanah to reinforce the correction already accomplished at Sinai and to prepare the correction yet to come, while Maamar HaChochmah, Chelek 1 6:4 adds that the essential power of the shofar-blast below, and the force of its root above, is to strengthen the good and subdue the evil.
Shem MiShmuel, Erev Rosh Hashanah 2 develops a parallel between the original creation and the annual renewal: the seated tekiot of Rosh Hashanah awaken the very breath of creation — "He breathed into his nostrils a breath of life, and one who breathes breathes from within himself" — so that through the shofar-blasts the person becomes once again a living, speaking spirit, just as Adam was at his creation.
Sulam on Zohar, Vayera 381:1 teaches that on Rosh Hashanah and Yom Kippur, when judgment is present in the world and the Satan stands to accuse, Israel must arouse themselves with the shofar and sound a voice compounded of water, fire, and wind — the sefirot of Chesed, Gevurah, and Tiferet — unified into one voice emerging from the shofar.
Maamar HaChochmah, Chelek 1 6:3 states plainly that this day is a day of judgment and one must arouse oneself before God so that one's remembrance ascends before Him for good, while רש"ר הירש, תהלים קנ ג describes the shofar-blast as the solemn call that summons a person before God.
The urgency of that summons is captured by Netivot Olam, Netiv HaTeshuvah 1, which asks whether a person is not afraid to leave the world without teshuvah and calls on him to regret his deeds, and by Mesillat Yesharim 4:19, which teaches that it is proper to continuously shudder and fear, for who will stand on the day of judgment before a Creator whose scrutiny extends to the smallest thing.
Orot HaTeshuvah, Chapter 5:2 describes the nature of the sudden teshuvah the shofar catalyzes: an immediate spiritual lightning bolt that enters the soul, in an instant revealing the wrongness and ugliness of sin, transforming the person into a new being with a genuine felt change for the better — a teshuvah that comes through an inner miracle, through a great spiritual influx.
Chayyei Adam, Shabbat and Festivals 138:1 and Mishnah Berurah 583 confirm that these days are days of divine favour, rooted in the forty days Moshe spent on the mountain from Rosh Chodesh Elul through Yom Kippur, and the Mishnah Berurah adds in the name of the Shelah that a person should arouse himself to teshuvah wholeheartedly when reciting the Yehi Ratzon prayers, combining that inner work with joy and trust in God alongside repentance and good deeds.
Sefat Emet, Devarim, Rosh HaShanah 3:3 closes the circle by noting that Rosh Hashanah is itself a festival — God's gift of the Day of Judgment as a day of celebration — because on this day new time begins and the concealment of the past year is removed; life-force flows from a place above nature and time, and within every Jew there is a hidden point in the heart that the shofar is sent to awaken.