Schwartz is all fun and games, literally. Along with Peter Ivanovich, Schwartz is another colleague of Ivan's at the Court of Justice. Though it's never directly said that Schwartz is a friend of Ivan's, we know he is at least a friend of the others (Fedor Vasilievich, Peter Ivanovich).
The always suave, always elegant Schwartz doesn't let anything get his spirits down, including Ivan's funeral. He pleasantly distracts himself by thinking about bridge the whole time, and manages to perk up Peter Ivanovich's spirits too. He doesn't feel any sadness for Ivan. Apparently in Ivan's last days at the work place, Schwartz in particular irritated Ivan by making jokes about his illness and being contagiously good-humored. From all we see of him, Schwartz just might be the most shallow and false character of them all.
It's revealing, then, when the narrator tells us that Schwartz in particular reminds Ivan "of what he himself had been ten years ago" (4.23). Schwartz is a character who stands in for the Ivan of the past. By comparing Schwartz to Ivan, we can see just how false Ivan was before death forced him to face his own life.