Perhaps it would be helpful if you gave us a link to the solution you found, so we could see the whole thing, and you could focus on the specific points you don't understand. When you say "I used", I suppose "I" means the person who wrote that solution?
Presumably they are using [x] to mean the floor (greatest integer) function, and you understand that. The string of inequalities using x is meant to be generic; the x there is not the x in the integral, but means "any number". (It might have been clearer if they had used a different variable there, such as u or a.) Do you understand and agree with each individual inequality there? If not, make sure you do, because you need to understand it in order to apply it.
In the corresponding string of inequalities involving the integral, they have not replaced x with the integral as you imagine, though it looks like that superficially because In is in the middle. Rather, they have applied various parts of the general inequality one by one, mostly replacing x with n/pi. For example, the first integral inequality comes from the fact that n/pi - 1 <= [n/pi]. The following equality comes from the periodicity of the function. The next inequality is due to the fact that the interval over which they integrate has been reduced in the integral on the left.
By the way, in reading this string of inequalities, I started at In and read to the left and to the right in order to understand what they are doing. The most important thing here is to think about each step by itself, not just to imagine some global substitution. As yourself why each thing is true.
Also, I am troubled when students try to "solve" a problem by looking for a solution on the internet. If this is for a course, you should be starting with what you have been learning, and think about how it applies. (If this is a contest preparation problem, things are a little different.) Too often, what you find is not written for you to read with the knowledge you have, so trying to read it only makes things harder for you. In the long run, it is easier, and better for learning, if you think for yourself rather than try to follow someone else's thinking, which may not be the way you would think.