Learning a bit more about European history, I've come to the conclusion that the whole idea of nation(that is, a group of people bound together by shared culture and language) didn't really exist until XIX century, with many being basically constructed by a small group of intellectuals.
Would that be a misconception? I imagine that it's far more complicated than that, but it would still be interesting to know what the historical consensus on this issue is.
This is a hugely controversial question that historians and social scientists return to time and again. I will offer my own take as a historian. You should beware that this will neither be a "fringe theory" about nations nor a reflection of the consensus among scholars.
Let us define a nation as a group of people bound together by shared culture and language as you have done. I will add a further condition. Members of a nation should recognise and (tacitly or explicitly) agree that they are members of the nation. That is, there must be some things in common, an awareness of these things, and an attitude that confirms that for individuals in question these things had some importance in terms of the way they categorised people. Your question, therefore, boils down to two things. First, were there common cultural and linguistic links between people? The answer is obviously yes. Second, were people aware of such links, and did they find these significant enough to imagine themselves as belonging to a category that excludes others that do not share these bonds? The answer is less obvious now but I think it is, again, yes. I will try to show how this is so by looking at the Ancient Greek example.
The Ancient Greeks called foreigners "barbarians", though not always in the pejorative way we use the term today. The term derives from the fact that these foreigners did not speak Greek and thus sounded like "babababababa" to the Greeks. In line with this and strictly speaking, a Spartan was not a barbarian to an Athenian. They belonged to different city-states, they also believed they hailed from distinct ethnic branches (the Athenians Ionian, the Spartans Dorian), but they both spoke Greek and were not barbarians. The next step would be, presumably, seeing how else these categories are divided beyond speaking different languages. Some Greeks believed there were different ethical standards prevalent among different peoples. Following the Battle of Plataea in 479 BCE, the leader of the Greek army, Pausanias the Spartan was approached by another Greek, who asked him to decapitate Mardonius the leader of the Persian armies and impale the severed head as a revenge of the fallen Spartan king Leonidas, according to Herodotus. Pausanias replies that Pausanias reproached the man for this proposal, which he finds more befitting of barbarians than Greeks, and even wrong for barbarians (Histories, 9.78-79). Now, whether Pausanias actually replied this way or not scarcely matters. What matters is a source from the 5th century BCE imagines a Spartan commander draw a moral distinction between Greeks and barbarians and clearly situate Greeks as more morally advanced. There are other, further examples from Herodotus that go beyond ethics. Indeed, throughout his histories, Herodotus provides an account of how various Greek city-states came together in the name of fighting a common enemy, that is the Persians, and subsequently forged a stronger sentiment of Greekness. In Histories 8.144, for instance, upon rumours that Athens would go over to the Persian side, he has Athenians assure Spartans that they were not willing to betray their religious, ties of blood, the language they have in common and so on. While it is not prudent to attribute a modern understanding of nationalism to this reply, I also do not see how else we can explain its argument but for something that satisfies our conditions of being a nation.
Another ancient historian, Thucydides, wrote a history of the Peloponnesian Wars that was waged between the Athens-led Delian League and the Spartan-led Peloponnesian League following the Greco-Persian Wars. We know that there was a name to refer to the lands of all Greeks (Hellas), a distinction between Greeks and barbarians, and also (at least at times) joint expeditions and combined actions among Greeks. We know, simply because Thucydides says that before the Trojan War none of this existed (The Peloponnesian War, 1.3). Elsewhere, he describes a naval battle between Corinthians on the one side and Athenians and their allies on the other as the greatest sea battle ever fought "by Greeks against Greeks" (Ibid, 1.50). Likewise, Thucydides reports that the Corinthians said the Spartans prided themselves "as the liberators of Greece" (Ibid, 1.69).
I have used ancient Greece as an example but this certainly does not mean that being a pre-modern nation was limited to them. There is an example from the 15th-16th century Ottoman chronicler Mehmed Neşri Efendi, who has Murad I (r. 1362-1389) threaten the Serbians in the following way: "Hopefully I shall show them Turkish manliness/courage (erlik in Turkish)". If Neşri thought this was possible for Murad I to say this, then it certainly was possible to think this way in his own lifetime. That there existed a people called Turks and that they possessed a particular manliness/courage was an idea at least one individual held centuries before the modern nation-states emerged.
The examples are numerous and they all show that ancient Greeks (and Ottoman Turks, and many others) saw themselves as belonging to a community that shared certain cultural and linguistic bonds. Despite their differences, ancient Greeks thought they were all Greeks rather than barbarians. This, too, is an important point. The opposition that a- the Greeks were too divided and fought against one another rather than cooperating and that b- there were other, stronger forms of identity such as being an Athenian/Spartan will not do. Sometimes modern nations also become divided and civil wars occur (so a is invalid), and everywhere today, there are other identities that sometimes override the national identity: being Texan, being Scottish and British, being a Balkanian Turk, being a Pontic Greek (so b is invalid)... Just as we do not say that nations do not exist because such objections obtain, we should not say something similar to "nations" did not exist before modernity. Nations are not modern inventions. There were various words used to define such communities based on blood, cultural, and linguistic ties, but they all referred to more or less "nations". What remains to be done is to trace its evolution in different places, to see how and why continuities and ruptures occur, and what is the practical political impact of being a nation at a given time and place.