Many visitors to this website come here while searching for the phrase "what is music" in a search engine.
The main portion of this site provides a speculative scientific theory. But there are many other types of answer that can be given to this question, and perhaps one of the following is the type of answer that your were really looking for ...
Because we are all familiar with the experience of music, we are inclined to think that we truly know what music is. But having an experience is not the same thing as fully understanding how that experience occurs or even what it represents. Seeing is not the same thing as understanding the physics of light, and hearing is not the same thing as understanding about sound and acoustics. Everyone "knows" what consciousness is, but scientifically no one knows what consciousness is. (There are various theories, but no one really knows that any of those theories is correct.)
This comes down to a distinction between objective and subjective. There are some phenomena where our knowledge of the objective correlate of our subjective experience is quite advanced. For example, we understand that words like "hot" and "cold" are correlated with an objective physical measurement of temperature. There is a quite mathematically complex theory of temperature and heat. And we have a detailed understanding of the biology of our perception of hot and cold, of how, for example, that our perception of temperature is actually a perception of temperature difference between receptors close to the surface and receptors further inside our body. We also understand why we perceive temperature, and most people would not find it not too difficult to understand that we perceive hot and cold because too much hot or too much cold is bad for your health.
In the case of music, there is a substantial descriptive theory of music, which corresponds to a large degree to what is called "music theory", which is almost like a scientific theory, but not quite. Anyone who learns to play an instrument or learns to read music notation will learn some of this descriptive theory. It includes concepts like frequency and tempo, and all the components of music such as melody, scales, chords and rhythm.
Although music theory tells us something about what music is, there is still quite a lot that it doesn't tell us:
The incompleteness of any existing formal descriptive theory of music implies that the only way that you can explain to another person the meaning of the word "music" is by example. In other words, if you were teaching some person English, and you didn't know any word for "music" in their language, you would be forced to play some music to them, and then tell them that that's what music is.
There is one apparent problem with a subjective answer to the question, which is that there is variation in what different people consider to be music, especially if they come from different cultural backgrounds. This can lead to an extreme relativism, where it is claimed that anything at all is music if someone says that it is. For example, according to well-known composer John Cage, his work 4 minutes 33 seconds of pure silence is actually music.
My own view is that this degree of relativism is an over-reaction. The problem with phenomena which are only known subjectively is that people can support relativist points of view by simply lying about their own perceptions. For example, different men disagree about what is "sexy", and I could pick some woman that most other men find not very attractive, and claim that she looks sexy to me. Anyone accusing me of lying would be implicitly insulting the woman in question, which wouldn't seem very polite. But most people know that there is quite a lot of agreement about what men consider to be sexy or not in a woman, and most scientists would presume that this agreement is a function of a common genetically determined instinct.
Similarly, we know that there is quite a lot of agreement about what is musical. Much of the music industry is "hit-driven", which implies that if one person likes a particular musical item a lot, probably a lot of other people will also like it a lot. Also, we still recognise an item as musical even if it is not our favourite kind of music, and even if it comes from another culture. And I don't think anyone really thinks that four and a half minutes of silence is musical.
Given the difficulty of finding a scientific answer to the question of what music is, and the disinclination of many people to think scientifically about human desires and feelings, one way to answer the question is to give an answer that doesn't even pretend to be scientific. Instead of trying to find an answer that makes specific statements about what is music and what is not music, and what is going on inside the human brain of someone enjoying music, and why music perception is an evolved adaptation, just say something that doesn't really mean anything at all, but it sounds good. Like:
"Music is a hidden arithmetic exercise of the soul, which doesn't know that it is counting." (Gottfried Leibniz)
I copied this from "Definitions of Music" in wikiquote, and there's plenty more at that site. Another music quote site that includes a few poetic "definitions" is http://home.att.net/~quotations/music.html.
Although there is no widely accepted scientific theory of music, there have been plenty of attempts to formulate theories of music, and these could be considered possible answers to the question. In most cases the scientists who have stated the theories would not themselves claim that their theories can be known with certainty to be true, but if you wanted to make a statement about what music was from a scientific view, you could quote one of these theories and make it sound more definite than it really was.
Some popular scientific explanations of music include:
Most of these theories have an element of "just so" story about them, and you will notice that none of them say very much about why music has exactly the properties that it has (i.e. all the properties described by descriptive music theory), and certainly none of them explain why particular items of music are regarded as very musical by large numbers of people.
If I was an authority on music science, then I could give my own authoritative answer to the question. Unfortunately no one takes me very seriously yet, so I don't make a very good source, if that is what you are looking for. On top of that, my own theory is admittedly both speculative and incomplete.
A best possible answer to the question, given our current knowledge and ignorance of what music is, must be something as follows: