The three parts of the
soul and thus
justice in a city as described by Plato/Socrates (P/S) are Wisdom, Courage, and
Moderation. These three things correspond with his
caste system that he believes makes up the ideal and most just society. The kings are at the top of the caste system having the greatest wisdom because they have the greatest reason, the guardians are second in line because they have spirit which allows them courage, and the general population, the workers/carpenters have appetite which means they must know moderation.
Moderation is the balance and harmony that must exist between these three things, and within these three things individually as well. Justice is that each individual in the caste system do, as they inherently ought to do. P/S believed that education was the manner by which society was able to weed out those that needed no further teaching from those that should receive it. It was, in fact, the way of determining to what category of the caste system an individual belonged. (Mind you, I say individual but he/they meant men.)
Thrasymachus had a view of justice that seems to mirror Marx's own view of the world. P/S loops Thrasymachus into his own contradiction however, by asking him if the people in power make mistakes, and when Thrasymachus
answers yes, he also asks if those without the power are just to go against a law or err made by that power. T answers yes again and so Socrates shows him that he has contradicted himself by crating a situation in which the law is not just, and instead the powerless are. The meek are Just for being Unjust, so to speak.
The dialogue ends with Thrasymachus being outsmarted and throwing up his hands, and Plato alluding to the idea that a just ruler works for others and their benefit. But does P/S really ever give this answer? He shows that if a ruler is capable of being wrong in his decision, but the rulers are supposed to be justice, then there is a presupposed standard of what is right and what is wrong. I do not, however, think that he
truly answers the question himself, or ever definitively tells us what justice truly is. P/S seems to go on to point to a higher form, or rather, a god of sorts.
More summaries about the Plato's Republic (dialogue with Thrasymachus)