Not uncommon in baseball. Despite the myth among some fans that players start slacking off or malingering once they start making any money, almost all players are hardwired to be warrior competitors who are driven to excel on nothing more than its own terms. That competitiveness and drive were how players were able to rise through the ranks to the majors over lesser players in the first place. So playing through injury with an eye toward prevailing over adversity is a pretty common thing in the game, particularly among players who are one bad streak from seeing their careers end, which, if you think about it, is most players at any given moment.
It may be worth noting that Foley was an undrafted free agent who bloomed after college, so I hypothesize he might be more susceptible to simply losing it than those who had elite skills since childhood. Remember, too, that he is already 28 years old and that’s about when baseball aging starts calling for many.