Like Chris said, that is the speedometer hand lock SOLENOID. It's a coil of fine copper wire wrapped around a tubular center/core. When a button is pushed on the handlebars, current flows through the coil, magnetizing it and pulling the spring loaded end plate down (which is attached to the plunger inside the hollow core). The plate gets latched in the energized position by the spring loaded clip on the plate end. Meanwhile, the rubber tip of the plunger is being held firmly against the speedometer needle wheel inside of the speed effectively locking it in its position the moment that the button was pushed. A purely mechanical button protruding from the left side of the dash cover acts on the plate latch and releases it from its locked position and freeing the needle as well.
Mark