From what I've read about 4-pin fans the tach signal generates 2 pulses for every rotation. You could set up a timer and toggle a digital output. I have used the TimerOne library for outputting signals in which case you just tell it to configure the timer with the desired frequency. There may be better libraries but this has worked for me.
To measure the PWM input you could use pulseIn() to time the HIGH and LOW pulse length of the input to determine frequency and duty cycle, however you can't do anything while pulseIn() waits for the signal to change. Alternatively you could use pin interrupts to measure the length of the input pulses if you don't want to stall your program while waiting.