I am interested in the difference between these to seemingly synonymous terms.
"Egotism" is an inflated sense of one's importance; it's being conceited or vain.
The egotist feels superior to others physically, intellectually or in some other way.
"Egoism" is a preoccupation with oneself, but not necessarily feeling superior to others.
The egoist puts himself and his own needs before everyone else.
Egotist: I'm the smartest, prettiest and most talented.
Egoist: It's all about me regardless of how I compare to everyone else.
"Egoism" would be the term regularly formed of its Latin/Greek parts: ego + -ismus/-ismos. The t in "egotism" was probably added by analogy to some -ismes in French that have an intrusive t, which can be inserted between vowels in French.
The Trésor de la Langue Française informatisé and the Oxford English Dictionary seem to agree that the word was probably coined in English, in the colony of Port-Royal around 1714*. Since the intrusive t is not a native phonological instrument in English, it may be considered a Gallicism, not a borrowing from French; for that reason, some call "egotism" a malformation. Others say that such an attack on the intrusive t is unfair and that it should be accepted as English. The choice is a matter of style and of no great importance.
To some, "egotism" means being self-centred, whereas "egoism" is restricted to philosophy (solipsism etc.); however, it seems that this distinction is so blurred that both can be used for self-centredness. I believe this distinction is ignored by most writers.
*) OED, on egotism:
TLFi, on égotisme:
TLFi, on égoïsme: