Why do you feel you need to change the PWM frequency?
I used to work with PIC microcontroller and I used to test the best frequency that work with the motor cause it seemed to me through my personal experience that every motor has a specific pwm frequency that works great with it
You can power the Arduino from the same 12v source as your motors. Connect +12v to the Vin pin or to the DC power jack.
I didn't want to do that, I don't know exactly how much current the motor will require and I don't know the max current that the 5v regulator in my arduino will support. I'm really new with arduino

As for PWM frequency I don't think there's a specific library but it can be done by reprogramming the relevant timer module directly. If you want millis() and micros() to still work don't modify timer0.
I searched in the arduino site but I can't find any data sheet of arduino Mega ADK can you give me a link please.
Thank you all for your help.