My teacher used integration by parts to solve the problem like so: $$\int_0^2 xd(\{x\}) =[x\{x\}]_0^2+\int_0^2 \{x\}dx\\ =0+\int_0^1 xdx+\int_1^2 (x-1)dx$$$$\int_0^2 xd(\{x\}) =[x\{x\}]_0^2-\int_0^2 \{x\}dx\\ =0-\int_0^1 xdx-\int_1^2 (x-1)dx$$
which comes out to -1. But when I was solving I simplified the $d(\{x\})$ to just $(1)dx$ since the derivative of the $\{x\}$ is $1$ almost everywhere. $$\int_0^2 xd(\{x\})=\int_0^2 xdx$$ which comes out to 2, obviously not right. I have a feeling that the mistake is related to $\{x\}$ not being continuous everywhere, but my reasoning is that it shouldn't matter since we are integrating and hence finite number of discontinuities (in this case, only 1) shouldn't change the answer.