The present invention provides a coding gene having the nucleic acid sequence shown as SEQ ID NO:1 and the fusion protein RIG (SEQ ID NO:2) that inhibits osteoclast formation. The present invention also provides the preparation method for the fusion protein RIG as well as synthetic oligo-nucleotide primers, plasmids and host cells used in the method and a medicine having the above fusion protein RIG as active ingredient. The fusion protein RIG in present invention is derived from humanized immunoglobulin and RANKL with a flexible hinge region. RIG can cross link the cell surface receptor RANK and Fcγ 1 to induce a cytosolic inhibitory signal leading to the inhibition of osteoclast formation. The fusion protein RIG in present invention can play an essential role in treating osteoporosis and bone resorption diseases caused by tumor metastasis.