ilancio:
Would I still need relays for switching the output, or is there a built in function that can do this inversion?
That depends how much voltage and current you need to put out. If it's below 5V and 20mA then you can use the digital output pins directly. If you need more voltage or current than that then you would need a driver circuit to amplify the small output from the Arduino up to a level you can use. An H-bridge motor driver shield would be overkill but would give you a very easy solution.