What is classical music?

"Classical" is the name the Romantic composers of the nineteenth century gave to the period immediately before them, with Haydn, Mozart, Beethoven, and Schubert particularly in mind.
The use of the term "classical" was subsequently expanded to include the Romantics and both earlier and later composers. It was used to distinguish their products from "popular" music such as commercial and ethnic music. By implication, this use of the word "classical" denotes music that is primarily written, as distinct from music learnt by ear.
Beyond that, the term is a meaningless shibboleth.