Gold prices hit $4,000 an ounce for the first time Tuesday as investors piled into the precious metal at a time of stubborn inflation, a lingering government shutdown and deepening geopolitical risks.