Devide 12v square wave signal and output 5v squarewave

Retroplayer:
An optocoupler may be your safest way to translate the voltage. Car voltages are not always clean 12V and can go as high as 18v. A voltage divider wouldn't protect against that. Since you will be driving an LED on the 12V side, just select a proper resistor to keep the current under the transmitter IF spec. Most I have looked at are around 50mA, so around 240 ohms (330 is probably a little safer which is about 36mA.)

Are you just using the arduino to translate the input pulses of 12v to output pulses of 5v or are you using the arduino to actually calculate the RPM? If the latter, I am not sure why you need to output the pulses on another pin.

the output from th ECU is regulated to 12v, however, I've just googled optocoupler and it looks that it could be a good idea, I assume these a fast enough?

I'm using the arduino to calculate the RPM and then output a different RPM based on another input (gear selector)