וַתְּהִ֨י הַתְּשֻׁעָ֜ה בַּיּ֥וֹם הַה֛וּא לְאֵ֖בֶל לְכָל־הָעָ֑ם כִּֽי־שָׁמַ֣ע הָעָ֗ם בַּיּ֤וֹם הַהוּא֙ לֵאמֹ֔ר נֶעֱצַ֥ב הַמֶּ֖לֶךְ עַל־בְּנֽוֹ׃
Maka kemenangan pada hari itu berubah menjadi perkabungan bagi seluruh rakyat, karena pada hari itu rakyat mendengar orang berkata, “Raja berdukacita karena anaknya.”
Chizkuni
ויתעצב אל לבו, “He was saddened to have listened to the advice to create man;”A different exegesis: the words: אל לבו refer to the heart of man; G-d felt saddened on account of man’s heart, i.e. the constantly evil thoughts that he entertained. We find a similar construction in Samuel I 20,34 כי נעצב אל דוד כי הכלמו אביו, “he was saddened on account that his father had humiliated him.” (Yonathan about his father the King, humiliating his bosom fried David) Still another exegesis of our verse: Whenever the root עצב occurs it refers to mourning or something akin to it. Example: כי נעצב המלך על בנו, “for the king mourned over the los of his son.” (Samuel II 19,3, about the death of Avshalom) In our verse the Torah describes G-d as mourning the world He had created and which He now had to completely restructure. If you were to ask how it is possible to mourn people who had not died yet, this rule applies only to mortal human beings who cannot be sure of any event in the future until it materializes; G-d Who foresees developments clearly, can be saddened and in a state of mourning even before the actual event has taken place. Still another interpretation of our verse; the human race had become something only worthy of sadness and distaste.
Radak
ויתעצב אל לבו, this too, is a figure of speech, seeing that G’d does not know such emotional ups and downs as joy and sadness. While David in Psalms 104,31 speaks of ישמח ה' במעשיו, he too uses such “emotions” of G’d only as a figure of speech. It is his way of describing G’d’s reactions to seeing that His plans had worked out. Similarly, here, the Torah describes G’d’s reaction when His plans had not worked out. [G’d’s plans not working out can only happen due to the freedom of choice with which He endowed man. Ed.] In other words, the Torah, in telling us about G’d’s reactions, here and elsewhere, reflects the impressions gained by the teller of the story. אל לבו, we are told in Bereshit Rabbah 27,4 that a gentile asked Rabbi Yehoshua ben Korchah if it is not true that the Jews claim that their G’d knows all that is going to happen in advance. Rabbi Yehoshua answered in the affirmative. Thereupon the gentile quoted this verse as proof that if G’d had known all of this in advance, how could He have been saddened by it. Rabbi Yehoshua asked the gentile if he had ever have a son born to him. The gentile said that indeed he was the father of a son. He then asked him: “what did you do when he was born?” The gentile replied that he was very happy when he heard the news. Thereupon Rabbi Yehoshua asked the gentile: “did you not know that the son would die one day, and if so why were you happy that another mortal was born?” The gentile answered that there is a time to rejoice and a time to be sad. Rabbi Yehoshua told the gentile that G’d, in spite of His foreknowledge, reacts in a similar manner. G’d was in mourning for the destruction of His handiwork, as we know from 7,10. The reason the Torah makes mention of the words ויתעצב אל לבו and these seven days, is to teach us that the words אבל and עצב can be used interchangeably, i.e. they describe a state of mourning.
Rashi
ויתעצב אל לבו AND IT GRIEVED HIM AT HIS HEART— He mourned at the failure of His handiwork. Similarly (2 Samuel 19:3) ‘The king grieved (נעצב) for his son”. (Similarly here: God grieved for his (man’s) heart: that it had changed from good to bad). The following extract from the Midrash Rabbah I am writing in order that you may know how to refute the arguments of certain heretics: A gentile once asked Rabbi Joshua, the son of Korcha, saying to him, “Do you not admit that the Holy One, blessed be He, knows what is to happen in the future?” He replied, “Yes.” The gentile retorted, “But is it not written ‘and He was grieved in His heart’?” He answered: “Have you ever had a son born to you?” The reply was “Yes.” He asked (the gentile): “And what did you do?” He replied: “I rejoiced and I made others rejoice also.” The Rabbi asked him: “But did you not know that he must die?” The heathen replied: “At the time of joy, let there be joy, at the time of mourning let there be mourning”. The Rabbi then said: “Such, too, is the way of the Holy One, blessed be He: although it was clear to Him that in the end men would sin and would be destroyed, He did not refrain from creating them for the sake of the righteous men who were to issue from them” (Genesis Rabbah 27:4).