-
In almost all situations
That's kind of the point though. In some (very few) rare situations slowing down isn't necessarily the answer. (See how many caveats there were on that sentence...)
For example, contrived situation but quite common, being stationary and seeing a car reversing towards you. You can beep all you like but at some point moving away (which involves accelerating) is going to give you a chance of avoiding being hit. Do it in a panic and there's a good chance that you might end up hitting something/someone yourself.
Like most things, the answer is to do as much to avoid being in the situation in the first place (in this situation giving more room to the car in front) but sometimes even with the best judgement someone just does something so unexpected that you end up having to take avoiding action.
In my own experience I've had someone overtaking me on a motorway blow a tyre, swerve into the central reservation and then bounce off heading for me. In my split second WTF decision making I could have braked sharply (where I could either have been hit from behind by the person near tailgating me, or even by the careering car depending on how it's velocity changed post impact) or boot it into the clear lane ahead of me. I chose the latter and got away with it.
(The person tailgating me had been there for only a couple of seconds having pulled in behind me in order to overtake me. The lane to my left wasn't clear as I was overtaking someone myself.)
-
"how will the self driving car know whether to flatten the granny in the road or the child on the pavement?!"
hopefully the self driving car won't be in that situation as its only job is to actually pay attention to the road, won't be able to break the speed limit, and won't be distracted by a facebook notification.
In almost all situations, if you feel like there's actual danger the right answer is to remain in a straight line (or straight along the road) and brake. This is also the answer to the supposed conundrum of "how will the self driving car know whether to flatten the granny in the road or the child on the pavement?!"