is it cheaper to fix it or replace?
It depends on what type of platform pedal it is. If they are the basic plastic type, the bearings in the pedal are sealed - When they've worn out (when that happened to my bike pedals they were probably a bit rusty?), it's time for a new set of pedals. If they are the slightly more expensive (usually alloy) pedals, the bearings are not sealed - so they are able to be replaced and therefore the pedals have a much longer life-span. If you do need new pedals, it would be worthwhile upgrading to the pedal type meantioned above, because at least those bearings can be maintained regreased when required. Though if in doubt, ask your local bicycle mechanic. Prices - it depends on what part of the world you live, others here might be a more in the know. A quick look in your local bike or even sports shop would be a good idea.
It's cheaper just to replace the pedals you can get them for $4 to $20 on line or at a bike shop.