I am going out on a limb here, because my experience is with a /6 BMW motorcycle (early '60's era) speedo that looks very similar to yours. The shaft is mounted through the front arbor, through the bushing and then press-fit into the plastic gear. The gear has lost it's hold on the shaft - maybe just normal wear but more likely from heavy friction in the rest of the gear train for the tripmeter. The latter should resolve when you clean and oil the mechanism (I use a very light grade clock or gun oil). You can then try to super glue the shaft back into the gear (you will figure out when and where to put the glue so that you don't end up glueing the bushing also) or if you are handy with very small tools you can drill and pin the gear to the shaft. Note that the latter is a one-time only repair, you will probably never get the gear off again without destroying it.
Hope this helps, good luck,
greg
'64 230sl, fully sorted out...ooops, spoke too soon