When you are driving and stop at a light, do the pistons still move up and down due to combustion? If not how will the engine know when to combust the fuel to keep it moving?
The answer to your question is both yes and no.
Yes in majority of the conventional vehicles, the pistons keeps moving even when the vehicles is at a stop light. The idle RPM, which is usually between 600RPM to 1000RPM, signifies the speed of the crankshaft. The fuel is calculated by the ECU (or ECM or PCM) depending upon the load, which is a calculated based on readings from Mass Air Flow sensor, Manifold Absolute Pressure sensor, Intake Air Temperature sensor and Throttle Position Sensor.
Nowadays there is start-stop technology implemented in vehicles (commonly found in hybrid technology) and I have also heard of conventional vehicles having this feature. Basically engine shuts off when the vehicle is not moving to save fuel and as soon as the driver touches the throttle pedal, depending upon the load demand (aka throttle position etc.) fuel and spark timing is calculated by the computer and combustion begins to keep the vehicle transition smooth.
In most cars, yes the engine continues to rotate and the pistons go up and down in the cylinder bore due to combustion and the engine continuing to run. Some vehicles have an "auto stop" feature which kills the engine when it's not needed, but that's usually after several seconds of sitting still, as long as other parameters are met as well.
Most vehicles today have a tachometer. This is usually one of the two large gauges in the dash. The other tells vehicle speed. If you look at it when stopped, you'll notice the needle will most likely be pointing at ~600 rpm, meaning the engine is still rotating ~600 rpm even when the vehicle is stopped.
The vehicle you ride in must be one smooth running vehicle, as most vehicles have at least enough vibration to easily tell the engine is running. Good on yah.
To add to the other answers, in a manual vehicle, the road wheels are usually disconnected from the engine when at a stop either by putting the transmission in Neutral, or by depressing the clutch pedal.
In an automatic vehicle, a torque converter essentially does the same thing as a clutch, but does not require manual intervention.
These mechanisms prevent the engine from stalling when the vehicle comes to a stop.
I don't have enough reputation to comment, but the small economy cars (K or Kei cars) in Japan also have this StopStart feature, as Mauro commented (for European cars).
I think this feature is now common, say the last 3-5 years, across all K-cars (multiple manufacturers).
On these cars, this StopStart feature is also available on automatic cars, so the implementation is slightly different than explained by Mauro.
As an aside, the StopStart feature increases fuel economy.