I want to make a "gearbox" that will transform input rotational movement to an output rotational movement with the same speed but in the different direction (clockwise / counterclockwise) on the same axis. How can this be done?
Option 1 - just reverse direction without affecting the speed: Bevel gears in differential gear setup, with the carrier (the axle on which the intermediate gears are located) fixed to the chassis.
Option 2: reverse direction and change speed by a large amount. Planetary/epicyclic gear, fixed carrier (the green part in the image below) fixed to the chassis with the second shaft connecting to the ring gear (pink). Changing gear ratio between the ring gear and the sun gear (yellow) changes the speed and torque on top of reversing the direction.
Option 3: Use two universal joints to offset the shafts relative to each other, so that they are no longer in line, then use a standard gear to reverse the direction, possibly changing speed a little in the process.