The Latin abbreviations i.e. and e.g. are the cause of confusion for many people, and are often used incorrectly. There is a very simple way to know which is proper to use, simply by understanding their meanings and what they stand for.
"I.e." which, written out fully in Latin is "Id Est," means "that is," or "in other words." The second example, "in other words," beginning with the letter "i" is an excellent way to remember its meaning, (i.e. = in other words). It specifies, or makes more clear.
"E.g." comes from the Latin "Exempli Gratia" and its translation is "for the sake of an example." Again, there is a very easy way to remember the meaning and therefore usage of the abbreviation, in that "example" is in its description, (e.g. = example). "E.g." is also used in expressions similar to "including," when you're not intending to list everything that is being discussed.
Both i.e. and e.g. are most frequently used mid-sentence, and therefore are not capitalized. However, if you begin a sentence with one of them, e.g., "I.e." stands for "in other words," then you would follow the rules of capitalization, and the "I" would be uppercase.
Used mid-sentence, both i.e. and e.g. are always surrounded by commas. A comma ALWAYS comes after both abbreviations; the only time a comma does not precede one of them, is if you use one to begin a sentence. Both I.e. and E.g. look funny to most readers, but it is proper, following the rules of capitalization.
Some people question whether or not i.e. and e.g. should be italicized. The most accepted rule in grammar and answer to that question is that, both being such common abbreviations, they do not require italicization.
Hopefully this will give you a better understanding, i.e., clarify for you the difference between and the proper use of these abbreviations, so that when you're writing, e.g., that novel, you will have no problem determining which to use.