In short:
Socrates asks whether God loves the pious because it is the pious, or whether the pious is pious only because it is loved by God.
How does Judaism solve this dilemma?
In short:
Socrates asks whether God loves the pious because it is the pious, or whether the pious is pious only because it is loved by God.
How does Judaism solve this dilemma?
There is no one Jewish solution. I know of Rabbis who subscribe to Divine Command Theory -- the idea that "moral" is defined as "that which Hashem commanded". Which is pretty much the same thing as embracing the second horn of the dilemma. But most rishonim say things that imply they disagree. So instead, I will just give you what works for me -- a Jewish resolution.
In the gemara, Rav Nachman bar Yitzchaq says "גדולה עבירה לשמה ממצוה שלא לשמה -- a sin performed for the sake [of heaven] is greater than a mitzvah not done for its sake." ([Horiyos 10b], 1, Nazir 23b) What this means, and how applicable it is in practice, are topics of much discussion.
But I do not see how to combine that gemara with Divine Command Theory. It forces us to understand the "pious only because it is loved by God" horn of the dilemma to be about what is "lishmah" (for the proper sake) and not what is actually commanded.
So, what answer to the Euthyphro dilemma do I personally like?
I would argue that HQBH created the world with a tachlis, a purpose, He placed each of us in it with a tachlis, and what is righteous is righteous because it is in accordance with furthering that tachlis. This fits Rav Hirsch’s etymology for “ra“, being related to \רעע, to shatter. It also explains why the word “tov” means both good in the moral sense (not evil) as well as in the functional sense (not ineffective, as in “a good toothpaste prevents cavities”). To prepare the menorah’s lamps is called “hatavas haneiros — causing the functional usability of the lamps.” Moral tov derives from the functional tov. Hashem chose “Do not steal” over “Take whatever makes you happy” because that’s what makes us better receptacles. We might have remained with two definitions of tov (and of “good”) — functional and moral. According to this line of reasoning, “good at its job” is the underlying meaning of tov in the moral sense of the word as well.
So yes, HQBH did choose good vs evil without being subject to external constraint, and yet still the choice was not arbitrary. Socrates gave Euthyphro a false dichotomy — there was a third choice. Hashem has a reason, but that reason wasn’t conforming to a preexisting morality. It is consistency with the design choices when making the universe.
One last issue: Why should I follow the purpose for which I was created? What changes G-d’s motivation into my moral imperative?
We can prove the two are identical logically. In order for my moral choice to have any meaning, I must assume my actions have value. Otherwise, what difference does it make which actions I choose to perform? If I believe my actions have value, I am assuming my existence has value, since it makes those actions possible. And thus, presumed in the very quest for morality is the notion that the purpose for which I was created imparts value.