In All My Sons, how does Miller present Joe Keller as both the tragic hero and villain?
This is a great question, focussing on the ambiguity of this central character to the play. Your answer will want to focus on the presentation of Joe Keller in the play, and how, in a sense, he is a hero in what he has achieved in his life. Note how when we first are introduced to him Miller describes him in his stage directions as follows:
A heavy man of stolid mind and build, a business man these many years, but with the imprint of the machine-shop worker and boss still upon him. When he reads, when he speaks, when he listens, it is with the terrible concentration of the uneducated man for whom there is still wonder in many commonly known things, a man whose judgements must be dredged out of experience and a peasant-like common sense. A man among men.
There are a number of aspects to Joe Keller's character, but certainly we can see how is rise from labourer to owning his own factory that he manages is a heroic rise given his starting point. It is clear too that he is respected by his neighbours and the children of the neighbourhood, who almost treat him like some kind of surrogate grandfather, for example Bert.
However, the other side of this character which is gradually revealed is that his business success has only come at a cost - Joe Keller deliberately and knowingly produced faulty air plane engines which were used in fighter planes during the war and resulted in the death of 21 pilots. He blamed his partner and was acquitted of the crime, but during the course of the play he is forced to admit his culpability. Recognising that he was responsible for the death of not only his son, Larry, but for those pilots, as they were "all his sons," Joe sees no option but to kill himself.