G is the currency in Dokapon Kingdom, otherwise on-hand cash. G contributes to your net worth, along with Town value and Local Item value. There are many ways to earn G, such as:

In the story mode of Dokapon Kingdom and Dokapon Journey, the Adventurer with the most G will marry Princess Penny.

Your on-hand G can be swapped as one of the possible results of the Mix-Up Field Magic.

Also, your G, along with your net worth, is capped at 999,999,999 G. The only way to feasibly get this much money is to casino spam/Hero salary, and then Gold Bug abuse, or Alchemy/Magic Medicine duplication selling.