The idea of the fence has a number of meanings in the play. Fences keep things in and keep things out, both literally and figuratively for the Maxson family.
For Rose, the fence represents an opportunity to define and defend her family.
Rose thinks the partially built fence around the house will keep her loved ones safe inside.
For Troy, the fence has a more symbolic set of meanings.
Unable to open up to those that he loves, Troy keeps much of his emotion inside, building imaginary fences between himself and his family and friends.
Beyond symbolizing the idea of Troy's inability to communicate his emotions and his affection, fences also characterize Troy's view of the challenges he has faced in his life.
He feels restricted by race in his professional life, as he did in his athletic career. Death also represents a significant limitation for Troy, fencing off his potential in an absolute, inevitable and definite way.
Troy's rivalry with death can be seen as indicative of his mindset generally. Where Troy sees limits, he feels that he is being personally challenged to overcome those limits.
When Troy played baseball, he was never content to hit the ball into the stands. His hits always had to go over the fence.
What was true for Troy as a baseball player is true for him as a husband and father as well. When Troy feels powerless or limited, he acts out. We see this in his assertions of power over Cory (demonstrating that he will not be limited in his authority as a parent) and we see it as well in his adultery.
Every limit he perceives, he seeks to defeat somehow, including the limit of death.