This is called "dieseling" and is a bad thing. There are several reasons it might happen, but the short answer is "take it to a mechanic, tell him it's dieseling, and let him figure it out."
the car alarm will allow the car to start and run briefly then "shut down".
car needs a service
This is normal. These fans are run by a thermostat that keeps the engine cool. It will run for a short time even after the car is shut off.
because of the petrol that ignites with the engines through acceleration.
Fuel pump will not run and engine will not start.
You need to check your timing belt if it is not in time it will not start or run for a little then shut off.
Do they ever shut off? Some fans are designed to run a minute or so after the car is shut off to prevent boil over.
because when a car is on to long it will shut off because it was on to long
With many cars now days, the fan may continue to run after the car is shut off, or they may even start and run for a while after the car is shut off. An engine will actually get hotter for a short time after being shut off. Sometimes that will trigger a sensor to turn on the cooling fan. If it continually runs after being shut off, it could be a faulty temperature sensor, or a faulty fan relay, or even a bad computer.
If this is the fan that cools the engine it will run for a while after the car is switched off. If its the internal heater then I haven't a clue.
Your blower motor working even after the car is off is a good sign. This means that the car's system is preventing your car from overheating.
The car will not run without the keys in the car period.