PID Temprature control arduino

The third wire just gives you the rotation speed, not needed for PWM (except if it's the parameter you want to control). A 4 wire fan is better for PWM.

Your 2 wire fan is PWM capable anyway (but as runaway_pancake said in this post : "...While it can be varied to some degree it cannot be done well. It's like varying a brushless motor's speed by PWM'ing its ESC's supply voltage").

You can use a N-channel mosfet inserted in the ground branch of your fan power supply or a P-channel mosfet inserted in the upper branch (signal will be inverted though).