"Or do they say, 'He has invented it?'" means: the polytheists say that Muhammad has invented the Quran; meaning: they have indeed said it, and it is in the form of an interrogative. "There has not come to them any warner before you," meaning: the Quraysh. "That they might be guided," meaning: in order that they might be guided.
﴿أم يَقُولُونَ افتراه﴾ يَعْنِي: الْمُشْرِكِينَ يَقُولُونَ: إِنَّ مُحَمَّدًا افْتَرَى الْقُرْآنَ، أَيْ: قَدْ قَالُوهُ وَهُوَ عَلَى الِاسْتِفْهَامِ ﴿مَا أَتَاهُمْ من نَذِير من قبلك﴾ يَعْنِي: قُريْشًا ﴿لَعَلَّهُم يَهْتَدُونَ﴾ لكَي يهتدوا