Rusty Front Derailleur – Replace or Repair? My front derailleur has stopped shifting. Have a look at that rusty spring. Is it worth trying to fix, or should I just replace it?
It looks like a cheap enough derailleur that replacing it shouldn't cost too much, and the rust is severe enough that if the derailleur has stopped shifting I'd replace it.

If you can force the derailleur to move with your hand it's very likely to can repair it just by pouring sufficient oil on it and working it backwards and forwards for a while. 

But whatever has caused it to rust will still exist afterwards, so unless you fix that problem the new/repaired derailleur will just rust again. If you buy a slightly more expensive one it will use better steel so will rust less readily, but the real solution is to stop leaving it out in the rain, or at least cover it. If the problem is salt spray, all you can really do is put a coating of grease on everything and reapply that every few months. Which is a good idea with derailleurs anyway, especially cheap ones.

Use chain lube that's grease-plus-solvent and put a few drops of that on to the derailleurs when you oil your chain. You can save money by doing this, as $5 worth of chain lube will double the life of the chain, and probably the derailleurs too.

For bikes like this a half-decent chain lube is often a miracle cure. Run it into the brake and gear cables, put it on all the pivot points you can find, coat the corroded metal with it, go a bit wild. But 3-in-1 oil and a top coat of grease will work better on the derailleur spring - you want thick and gooey for that. I use "TriFlow" but any of them will work (with the caveat that WD40 and so on are degreasers, not lubricants)