I was taught at school that the following expression is not grammatically correct:
Who is there? It's me.
The correct one is:
Who is there? It's I.
Can you let me know which one is accurate?
As reported from the NOAD:
pronoun [first person singular]
1. used by a speaker to refer to himself or herself as the object of a verb or preposition:
Do you understand me?
Wait for me!
• used after the verb to be and after than or as:
Hi, it's me.
You have more than me.
• informal to or for myself:
I've got me a job.
It's then correct to say it's me.
"It is ME" is not grammatically correct in the academic sense, but is used in spoken English.
"It is I" is grammatically correct in the pure sense, but would never be used in spoken English - or very rarely by people who speak in an ultra-formal dialect.
"It is I" would have been correct in Shakespeare's time, in spoken English, but not now.
The answer to the question 'Who's there?' is 'It's me.' 'It is I' would normally be heard only when something else follows it, and then only in rather formal contexts, as in 'It is I who have done all the work, so it is I who should get the compensation.'
"It is me," is more common, and correct. However, "It is I who am here," is also correct, and "who am here" can be left off and implied, making "It is I," also correct.
This question is related to I can run faster than... In that exchange nohat describes the pronouns being used in the nominative and accusative cases. Modern English speakers have become more comfortable using the accusative case in comparisons even though traditionally comparisons have used the nominative case. It is further noted that "both forms are standard."
Modern English has slurred the distinction between cases, using word order to denote case rather than declension. We still use different words for most personal pronouns (he/him, I/me, we/us), but have lost it for you/you. "I talk to you." "You talk to me."
When asking "Who is there?" it would be correct to answer in the nominative case, "I am here." Likewise, asking "Who is it?" should elicit "It is I" or "I am it."
While it is formally correct to say "It's I", while informal or popular usage allows "It's me", it would be incorrect to say "It's him and I" (as in the title of a currently popular song), which mixes objective and nominative cases; it could be either "It's he and I" or "It's him and me".
It varies on context.
Who called Jodie? It was he.
Who told you about it? It was I.
Who had the phone conversation? It must have been they.
Who cares? It is we.
An aside: when you knock at a door, and someone from inside asks "Who's there?", Don't answer "Me" or "It's me". Aside from being ungrammatical, it conveys no information (unless the other person knows your voice).
We need to make the distinction between written and spoken English, especially informal spoken English - as between friends. Almost everyone says things like "Me and my brother went to the beach", but you certainly wouldn't say that giving a speech in a public forum.
Here's a good exlanation of the "it's me/I" construction:
"The traditional grammar rule states when a pronoun follows a linking verb, such as "is," the pronoun should be in the subject case. It’s also called the “nominative.”