The readings in the picture was effectively taken with 50Ohm impedence set on function generator, and since I've got the same results even with BNC cable plugged in directly into the input of the DSO, I guess this can be caused by the BNC cable and grabber capacitance.
The impedance must match - 50 ohm on the generator, 50 ohm terminator at the scope end of the cable - to correct the ringing. You are correct that it has to do with the cable capacitance (and inductance) - since you can't eliminate them completely, you have to work with them instead of against them at higher frequencies; that's what terminators are for. The capacitance and inductance of the cable form its
characteristic impedance, and if you match that at both ends, the frequency response becomes (ideally) flat and the ringing goes away.
By the way, when I'm injecting a signal into a circuit and take a reading, I wonder how can I distinguish those artifacts from those caused by circuit issues!
Intuition and careful probing. If you're injecting the signal into the circuit, try placing a 50 ohm resistor (47 will do) across the cable right where you connect to the circuit. And watch out - if the generator expects a 50 ohm terminator and doesn't get one, the signal amplitude will double, which could easily fry a digital circuit.
The probe itself can also ring - in fact, above a couple MHz, it
will. This is caused by the length of the ground lead forming extra inductance. If you need to probe high-speed circuits, remove the ground lead. There's a ground ring on the probe right by the tip - you can attach a very small "spring" ground to this (make it with a piece of stiff wire if you must; keep it less than about 2cm long), and ground it to a point very close to where you are probing. At
very high frequencies, it can be useful to build test points with convenient grounds into the circuit itself. At
ridiculously high frequencies, you might even include a small RF connector on the board so you can use a coax cable directly without a probe... But if you're anywhere near that domain, you'll know it!
p.s. Thank you for the suggestion on the 10X probe setting; if you have time to dedicate me, I'd like to understand in wich rare situations is required the 1X settings.
Small signals, where the 10X attenuation makes the signal too small to see clearly on the screen.
If you didn't know, the probe's bandwidth becomes almost ridiculously low on 1X: