The imposition of taxes, which must be paid in government currency, is precisely what gives government currency its worth.
Then why does it have worth OUTSIDE of the country as well?
Well, if Japanese valued their Yen, it makes sense that anyone else around the world would also value the Yen, because they can buy things from the Japanese with it.