What really is inflation? I understand that you measure inflation by first measuring what the average person buys. Then you compare the total cost of these goods in year x with year y to get the inflation (from x to y).

The problem: Not only the cost of goods, but also the quantity that people buy changes all the time. Things go out of fashion or are replaced by different (better?) things. When you calculate inflation, you implicitly assume that the amount of goods people buy is constant (during the measurement period, say one year). 

I do not doubt that this is reasonable from the practical perspective. But I doubt that today's inflation measurement approximates a well-defined concept. 

Assume you know for every day/month/year how much people buy from each product and what it costs, what would be the formula for inflation? How do you incorporate the fact that people might by apples at 1\$ in May and oranges at 2\$ in June, i.e. that costs and quantities change all the time?
This is a really big topic and you're essentially questioning why don't we calculate price levels using Paasche's indexes instead of Laspeyre's. Well, one "simple" answer is that's it's very expensive to maintain a detailed account of what a representative consumer basket should be. 

There's people trying alternatives to this, like the Billion Prices Project, but their estimated inflation is very close to the one we estimate through traditional, constant consumer basket method.