The long-standing discrepancy of the muon anomalous magnetic moment (g - 2) is a hint of new physics beyond the standard model of particle physics. In this paper, we show that heavy new physics contribution can be fully tested at a muon collider with a center-of-mass energy up to O(10) TeV with O(10) ab(-1). Even if there is no new particle in this energy range, one can measure the g - 2 operator directly via the channel to a Higgs boson and a monochromatic photon. In particular, the latter process, which is the most challenging case, can be tested in the 20[50] x (L-i/40ab(-1))(-1/2) TeV muon collider at the 2 [5] sigma level with L-i being the integrated luminosity if the efficiency of the detector built in the future is almost perfect.