I believe that is a John Deere #21 Hay Conditioner or "Hay Crimper" used to crunch up legume plants (alphalfa hay usually) after it was cut with a "one arm bandit" type sickle mower. These days, the cutting & crimping operations are being done with just 1 machine called a "haybine" as in "hay combine" which does both operations in 1 step. BTW: John Deere haybines usually have the ribbed steel crusher roll (like yours) engaged with a rubber sleeved top roll while New Holland haybines used 2 rubber coated rolls with interlocking chevron patterns to crush the hay releasing moisture more quickly.
I wouldn't toss it away just yet, as small acreage owners look into haying their own small fields to feed horses, sheep, cows, etc, with new versions of the single sickle mower that have appeared, which would benefit the owner/operator if they crushed the hay after mowing. Even some of the new model disk type mowers can't/don't perform this additional step.
Welcome to this Forum ! if you are just starting out tractoring/farming, field operation lawn mower stuff, you're going to love it here.