I have endless debates over this issue with people.
Some basics.
1. Gold has limited practical value as a substance.
2. Gold can be purified to a determinable standard.
3. Gold is not subject to rust, corrosion or any number of environmental conditions that would cause it to "waste away" over time.
4. Gold is a limited commodity. There's more of it in the ground, but short of stumbling across a very rich vein, the cost to extract and refine it makes obtaining more of it out of reach of the insanely-large majority of people in the world.
As such, precious metals such as gold, sliver, platinum, palladium, etc. make excellent forms of legal tender because the represent a set value that cannot be falsified or otherwise counterfeited.
Most all the world utilizes "fiat currency." This is "currency" that's not backed by anything except the promise of the issuer that it has value. So long as people believe it has value, they will accept it in trade for real goods and services rendered.
These currencies must inevitably collapse because it lends to "debt driven economies" where the incentive to just print the amount of currency needed to move an economy is very high. The supply of "money" (sic) is diluted until it truly is worthless and people realize that is so.
When people realize that the "currency" is worthless and the promise to honor it means nothing because the state has nothing of value to offer in exchange for the worthless paper, they go back to trading durable goods in place of "currency."
Most anything can become "currency" in such a situation, but durable goods only have the value the other party sees in it. A box of bullets might be worth 10 sacks of grain or 2 sacks of grain depending on how coveted it is by the person you are bargaining with. This is an unreliable economic model at best. Gold, silver, etc. became valued as "money" because they were durable and could be minted into coins that represented a unit of value. That they were rare meant they could be used to represent value. Paper money can be counterfeited. You could always mint your own coins, but you'd have to still have the gold and silver to pull that off. Make your own paper money and you create currency from nothing. Make your own gold coins and you really must provide your own gold.
This is why gold retains its value as a medium of exchange. It may not have the practical value of oil, but all oil is not equal. As the supply of oil decreases, the value of it goes up...an unpredictable rate of exchange.
Finally, the wealthiest families in the world settle their accounts in gold. Ultimately, what dominates as a rate of exchange depends on who is willing to use it (basic reason why "alternative energy" isn't going anywhere...no uniform accepted standard for what will be the new fuel we all use). Yes, the majority of the world uses paper fiat currency, but that's by the design of wealthy families that use gold and want to keep the gold largely in their own possession. The uber wealthy can collapse the fiat currencies and create a new feudal system on a global scale. Their gold endures, our fiat currency flounders.