My students regularly pronounce the word "company" with [o] in the first syllable. Why do we pronounce [ʌ] in this syllable? but write "o"? Thank you.
In a fairly small number of English words, the letter "o" corresponds the unreduced "short u" sound /ʌ/. This seems to be based ultimately on French spelling conventions that developed due to sound changes that caused some Latin "o" sounds to become /u/ in French: for example, the French word tout /tu/ comes from Latin totus (which had a "long o" sound in the first syllable in Classical Latin).
In older varieties of French, the sound /u/ could be written as "o"
As illustrated by the example tout, in modern French, the sound /u/ is represented by the digraph "ou". But in older varieties of French, it was possible for /u/ to be represented instead by the single letter "o", at least in certain contexts:
The Low Romance and Old French speakers were never certain how to spell unstressed o and ou sounds; they hesitated considerably. Initial unaccented ọ, free or checked, and ǫ free, presumably were pronounced ụ in Low Romance but they could be spelled u, o or ou: botellu > budel, bodel, or boudel. On the other hand a checked initial ǫ was spelled and pronounced ǫ: portare > porter.
– A History of the French Language, by Urban T. Holmes, Jr. and Alexander H. Schutz (p. 34).
"Anglo-Norman" also seems to have had /u/ as the quality of a nasal vowel
Now, the situation with words like company is a bit more complicated. The "o" comes before two consonant letters, "m" and "p", and in modern English the "m" corresponds to a nasal consonant /m/. In modern French, words like compagnie are pronounced with the nasal vowel /ɔ̃/ before the /p/, with no intervening nasal consonant.
But there is apparently evidence that pronunciations like /ũ/ were once used in some historical varieties of French; in particular, in "Anglo-Norman". I go into more detail in my answer to Why do “bomb” and “tomb” have different pronunciations?; basically, we see evidence of this /ũ/ sound in words like count, sound, noun, round, that are spelled with "ou" before "n" and pronounced with /aʊ/, and also in words that are pronounced with /ʌ/ and spelled with "o" or "ou" before "n" or "m"; e.g. country and front.
Middle English writers adopted and adapted French spelling conventions
In the Middle English period, many words from French entered English. Of course, these words tended to be spelled similarly to how they were spelled in French, which contributed to some of the unpredictable elements of modern English spelling. For example, we use the sound /ʌ/ in the word cover, from Old French cuvrir/covrir (spelled in modern French as "couvrir"), but not in the word over, from Old English ofer.
But in fact, a number of French-based spellings for vowel sounds ended up being used not just in loanwords such as cover, but more generally, and English writers ended up developing some of their own conventions for using these spellings that originated from French to write English vowels.
For example, the digraph "ou", taken from French, eventually ended up being used in English primarily to represent the Middle English "long u" sound /uː/ (that developed via the English "Great Vowel Shift" to the modern English diphthong /aʊ/, except for before labial consonants).
The Middle English use of "o" and "u" seems to have been influenced by the presence of adjacent "minim" letters
The Middle English "short u" sound /u/ (that developed via the English "Great Vowel Shift" to the modern English vowel /ʌ/, except for in a few words where it became /ʊ/), was often written "u", but also seems to have been written with the letter "o". At a certain point, there seems to have been a preference for using the letter "o" rather than "u" next to certain other letters: ones that were historically the same as or derived from "u" (such as v, originally the same letter as u, and w, originally a vv/uu ligature) and apparently also letters that were written with "minims" (short vertical strokes) such as m and n. Some native English words seem to have gained spellings with "o" due to this "minims" phenomenon, such as tongue, son, honey, come, and some, from Old English tunge, sunu, hunig, cuman, and sum. (I asked a question about this phenomenon that goes into a bit more detail: What's the current scholarly opinion on the “minims” explanation for the spelling of “love”, “tongue,” etc? Interestingly, a similar phenomenon apparently once affected the letter i, causing it to often be replaced with y next to letter like n and m, but that preference doesn't seem to have left a mark on Modern English spelling in the same way as the preference for replacing u with o next to minim letters.)
Now, the "minims"-based replacement of "u" with "o" hasn't had that big an impact on modern English spelling. From a present-day perspective, it's really an explanation for a few quirky spellings, not any kind of principle that modern English spelling conforms to systematically. There are many words like sun, run, lump, stump, bump that are spelled in Modern English with "u" next to an "m" or an "n".
But it seems possible that the "minims" convention of Middle English helped to establish the spelling of the prefix "con"/"com" with the letter "o" rather than the letter "u", even when it was pronounced with an /u/ sound.
The Latin etymology would have reinforced the "o" spellings
Etymology probably was even more important than "minim" letters as a factor that caused words starting with com- to end up having standard spellings with "o" instead of "u". The prefix com-/con- is spelled with "o" in Latin, and at certain points in the history of English (and French) using spellings that were close to Latin was considered more important than using spellings that were close to English or French pronunciation. That's how we got things like the letter "b" in "debt". The Oxford English Dictionary entry for com- says:
Before b, p, Old French had normally cum-, as in cumbatre, cumpagnie; although this was afterwards altered back to the Latin type com-, the original pronunciation remained in English, where its phonetic descendant still survives in comfort, company, compass, etc. But the influence of the spelling in modern times has been constantly to extend the use of /kɒm/ in all such words: /ˈkʌmbæt/ is even now dying out before /ˈkɒmbæt/.
There aren't actually very many words starting with com- or con- that are pronounced with /ʌ/ in present-day English, and as the OED says, the number of words like this has gone down over time because of the rise of alternative pronunciations with /ɒ/ (or in American English, /ɑ/). Aside from combat, two other words that have had multiple pronunciations like this are conduit (once commonly pronounced /ˈkʌndɪt/) and constable.
But as far as I know, in company, compass and comfort, /ʌ/ remains the only pronunciation in common use, at least in the accents that are typically documented in dictionaries and taught to English language learners.