The writer continuies to speak to Yahweh and to praise Yahweh for relating to people in ways that are approprite for how the people live.
# To one who is pure
"To anyone who is pure" or "To those who are pure"
# you show yourself to be pure
"you show that you are pure" or "you are pure"
# but to one who is perverse, you show yourself to be shrewd
The perverse person might think that he is wise and can sin without being punished, but God is wiser and will do to the perverse person what that person deserves.
# but to one who is perverse
"but to anyone who is perverse" or "but to those who are perverse"
# you show yourself to be shrewd
"you show yourself to be wise" or "you are cunning"