Some places I play have extreme erosion throughout the fairways, as well as near the teeboxes. Are there any ideas for preventing this? Maybe a trail through the course to force people to walk there instead of randomly through the fairway.
Creating a trail will not force people to walk it. (as much as we'd like sometimes to have that easy answer)
People will walk the path of least resistence (or
perceived path of least resistence) to wherever they want to go. For our sport, that means they will mentally work out in a fraction of a second that easiest, but not necessarily the shortest path from start point to disc location. Repeat many times over. That may include a common walkpath for many for most of that distance IF it is convenient, but then at some point they will of course stray to "cut to" the disc.
This will not be a 90 degree turn from the center fairway path if there was one, it is rather where it suddenly makes more sense to break off at an approach angle.
You multiply that out by all the throw and land possibilities and you see how disc golf foot traffic is not linear. We are not a line sport like hiking, biking. Other than a few discrete line elements, any attempt to turn dg into a line definied sport is futile. It's a patterned randomness. (general patterns of use develop and can be read, observed, and discerned after the fact, or anticipated by a well seasoned course designer, but not predictive for any one single user pass)
However, you could use that human nature in directing flow to your end advantage, much like you would do with water flow. Water flows downhill. People take the easiest path. You can divert, corral, obstruct, or curtail boots on the ground by the placement of obstacles if it aids in achieving some end such as mitigating erosion effects. Or entice it one way or another by creating a way that looks easy.
In wooded areas this could be the dragging in of a three man log, or a rockpile. A well placed mound of dirt could significantly steer most walkers. Mulching a walkpath "suggests" to the viewer that this is the easiest path, even if it is not. In the field, it could be a ditch, well placed hedgerow, etc, etc. Sometimes the simplest of measures can have a big effect.
So I can see erosion/compaction mitigation being approached in many ways, some by planning/design/redesign, some by maintenance or repair, some by diversion or obstruction to behavior we don't want, and some by enticements to patterns we do want.