That is a German KS98, also known as "dress" or "walking out" bayonet. It is not really a bayonet, the one in your picture cannot be fixed on a rifle.
It is a private purchase sidearm used instead of an issue bayonet for "walking out". It was customary for German soldiers to wear a sidearm with their uniforms also when on leave etc, and with dress uniforms.