My preferred fix for your situation is not to buy the cabin/beachhouse in the first place. The pilings are there to either take the load down to the hardpan beneath the sand (unlikely) or to distribute the load to the surrounding sand in a way I don't have room to explain here.
Essentially, because you are basically floating a building on a "liquid" the only way I know of to replace a piling is to drive another one in its place. Unfortunately, you have a building sitting on top so it's hard to do that.
I would do some exploratory digging around the piling(s) to see how deep the rot goes. It is possible to encase the piling, but I'm not sure its worth the effort.
Before you invest thousands of dollars into the place, have a licensed structural engineer take a look at it and make some recommendations. The 200-400 dollars you spend will be worth it if you discover you can't afford to repair the pilings.
Don't buy the place until you do this. In fact, the seller may be willing to split the cost with you.