How was money invented?

Trade was by direct exchange of goods. As trade expanded, it became expedient to have tokens instead of cartloads and shiploads of good, and as a store and reserve of value. So tokens were used - especially tokens which had a high intrinsic value of their own, such as metals and gems. To give some guarantee of value, states began to back the value of their curencies.