Well, let's start with an important point: things can be beautiful without being perfect, and John's brain is a perfect example of this little truism.
John has an amazing capacity for working through numbers and patterns and getting all kind of meaning from them. We totally don't get how he does it, but it's pretty cool—or, one might say, beautiful.
However, John's mind also kind of…well, misfires sometimes. He's schizophrenic, you see, which means that sometimes his mind kind of twists or misrepresents reality. And no, not in the way that an ex can twist the reasons you broke up—we're talking a total break from reality.
John never loses faith in his brain's abilities, though. In fact, he feels like his super noggin should be able to solve the whole issue of his illness. His doctor, however, isn't so sure:
JOHN: It's a problem. That's all it is. It's a problem with no solution. And that's what I do, I solve problems. That's what I do best.
DR. ROSEN: This isn't math. You can't come up with a formula to change the way you experience the world.
Nonetheless, John gives it a try, and he ends up mostly being able to function, despite going off his medications. So, while not perfect, it looks like John's mind and its "beauties" do help him slog through some pretty tough times.