Why does "inferred" have two Rs while "inference" doesn't?
Solution 1:
Monosyllabic words are not a problem: you know when to double a final consonant before adding a suffix, since the vowel in the word is always stressed:
rob+ed/ing/er = one final consonant preceded by one stressed vowel > double consonant: robbed, robbing, robbery, a robber
Words made of more than one syllable can be a bit of a problem:
The stressed syllable in the verb "to infer" is the second one.
So the rule which goes "before adding a suffix to a word, double its last consonant if the word ends in ONE CONSONANT only, preceded by ONE STRESSED VOWEL only" applies to the verb forms (past simple, past participle, -ing form).
infer+ed/ing = one final consonant preceded by one stressed vowel > double consonant: he inferred that… / he has inferred that… / inferring that…
But in the noun "an inference", the stress is moved to the first syllable. A case a bit similar to the noun "an increase" opposed to the verb "to increase". So, before you add the noun suffix –ence, you have a word "infer" ending in one consonant all right, but preceded by one UNSTRESSED vowel this time.
infer+ence = one final consonant preceded by one unstressed vowel > single consonant: an inference
Whereas in words like "to differ" and "a difference", the stressed syllable remains the same, the first one, and, as a result, the last consonant is doubled neither in the verb forms, nor in the noun:
differ+ed/ing/ence = one final consonant preceded by one unstressed vowel > single consonant: one thing differed from another / one thing has differed from another / differing from something / a difference
However, there are exceptions to this rule!
Michael Swan, in Practical English Usage, 2nd edition, 1995, Oxford University Press, wrote, on page 558:
"In British English, we double -l at the end of a word after one vowel letter in most cases, even in unstressed syllables.
travel > travelling; equal > equalled
In American English, words like this are normally spelt with one l: traveling.
other exceptions:
Consonants are sometimes doubled at the end of final syllables that are pronounced with full vowels (e.g. /æ/), even when these do not carry the main stress.
kidnap > kidnapped; handicap > handicapped; worship > worshippers (US also worshipers); combat > combatting or combating
Final -s is sometimes doubled in focus(s)ing, focus(s)ed, bias(s)ed, and similar words.
Solution 2:
It's yet another oddity of English taking Latin words. The Latin word inferre means "to bring in" (more or less). It's then easy to see how "inferred" came to be. But in 15th/16th century English, Latin endings (not even always suffixes, just endings) began being stripped from words. We gained "infer" to mean what inferre means. But, English being English, different spellings were VERY common. Standardization of the language didn't really even start until hundreds of years later. Prescriptivists and descriptivists fought a not-so-bloody battle, and now we have words that build differently than we expect because they were put into common usage.
As a brief aside, if you (or other readers here) are interested in these sorts of things, there's a book called Word by Word by Kory Stamper, a lexicographer for Merriam-Webster. She discusses quite a bit why words are the way they are. Also, dictionaries are not the key of perfection in English - they are actually written based on common usage. If we all started writing infered, given a decade and an edition or two, the spelling in the dictionary would likely change to follow suit.