No easy way to explain thr "It is I" issue so here goes. Sorry if someone has already explaonrd, I have skipped the middle part od the thread).
The verb "to be" is a verb of incomplete predication (unless it means "to exist").
In essence, for a sentence to be complete, it needs a subject (noun or prounoun) and a predicate (verb), e.g. The man eats. The woman stands.
"I am" is not a sentence (unless it means I exist). It needs something to complete "am" e.g. I am a doctor or I am tired. The bit that completes it is the predicative nominal (if a noun, e.g. "a doctor") or predicative adjective (e.g. "tired.).
A predictive nominal or adjective must agree with the subject. Subjects are always nominative (subject case) not dative or accusative (object case). The only words in English that decline are personal pronouns (I and me; she and her; he and him; we and us; they and them) and who/whom. The first one in each pair is nominative. Therefore, "It is I" is correct.
It is completely understandable that this is quite an alien concept for anyone who only speak English, given we don't naturally have a feel for subject and object cases. It is easiest to see this in Latin, but knowing any modern European languages other than English will help.
Before anyone comments, if you were asked "are you a doctor" and you say "I am" this is not a full sentence.
Therefore "It is I" is grammatically correct. However, "It is me" has been in common usage for so long that it is acceptable (sort of like squatters acquiring a right to ownership of property after living there for a long time).