Answer:
God had Saul fight the Amalekites because they ambushed on them as they were coming out of Egypt and they had committed sins in the sight of God. ( 1 Samuel 15: 1-3)
(1 Samuel 15: 6) “And Saul said unto the Kenites, Go, depart, get you down from among the Amalekites, lest I destroy you with them: for ye shewed kindness to all the children of Israel, when they came up out of Egypt. So the Kenites departed from among the Amalekites.”
Saul allowed King Agag to live ( 1 Samuel 15: 8)
Yes Saul knew that he had not obeyed God 1 Samuel 15: 24-25 says: Then Saul said to Samuel, “I have sinned, for I have transgressed the commandment of the Lord and your words, because I feared the people and obeyed their voice. 25 Now therefore, please pardon my sin, and return with me, that I may worship the Lord.”
When God said that he regretted making Saul king over Israel He was not changing His mind because God already knew that this was going to happen that is why God was sopossed to be their King not Saul but when Israel disobeyed God then imprefect humans made mistakes which had terrible results.