I understand the phrase "only child" means the only person born from or adopted by a set of parents in a family, or a person with no siblings. I often hear the term used as "an only child," which does not appear to be grammatically correct, but does appear to be the correct usage of the term. I have sometimes used "the only child" instead. Which phrase is correct? Is "the only child" incorrect?
X is "the only child" of his parents, and "an only child" along with Y and Z. Similarly, I am "the" elder child of my parents and "an" elder (and eldest) child along with bunches of other people.
One refers to the specific situation; the other refers to the classification.
Edited to add:
Consider the following examples:
Now what happens if Bob says "the" instead of "an"?
Bob can correct this problem with the somewhat cumbersome phrase:
Although at first glance "an only child" sounds ungrammatical, in fact "only child" is a noun in and of itself. From the Cambridge online dictionary:
As for using "the only child", I don't see why it would be considered incorrect. In a different context, one might say "the only jar on the shelf". Your version of the phrase is grammatical, but the compound noun above is the one people may be expecting in that given context.
An only child refers specifically to a person who has never had any brothers or sisters. The only child is more general; it refers to the sole child belonging to a particular group or satisfying particular criteria, which must be specified.
John is an only child. He is the only child of James and Susan.
Mike is the only child in the room right now. That does not necessarily mean he is an only child.
"An only child" implies that the person is the only child of their parents. The use of the indefinite article identifies the person as belonging to the subclass of children who have no siblings.
"The only child" also generally implies "of my parents", but it requires a qualifier, and is thus context-dependent. You could also be "the only child" in a group consisting almost exclusively of adults, or in a dystopian future someone could be "the only child", period; that is, the only person of young age in existence on the planet.