The simplest way to vary the speed of a DC brushed motor is to simply wire a rheostat (variable resistor) in series with it. However at part throttle the rheostat gets hot, wastes power, and provides poor speed regulation. Speed regulation can be improved by connecting both ends of the rheostat to make a potentiometer, but this wastes power even at full throttle.
Both efficiency and regulation can be dramatically improved by using an electronic controller which rapidly switches the motor on an off with a variable duty cycle. This technique is called PWM (Pulse Width Modulation). Commercial PWM speed controllers are readily available, or you can make your own using a handful of electronic components. here is an example:- PWM Motor Speed Controller.
A motor large enough to power a go-kart might be rated for 250W on 12V, and draw about 20A at its rated power. When starting up it will try to draw a lot more, however a solar panel 'automatically' limits the maximum current available. For example a 140W '12V' (17.5V open circuit) solar panel might have a short circuit current (in full sunlight) of 8A, and two in parallel would supply a maximum of 16A.
You can use a relay to reverse motor direction - just make sure that the relay contacts are rated to suit the current being drawn.