Imagine the lockers are numbered 1 - 100.
Each locker switches from closed to open, or vice versa, whenever it is a multiple of 1, then of 2, then of 3, of 4 etc.
So it switches as many times as its number has factors. For example locker 6 will be switched by person 1, person 2, person 3 and person 6.
If a locker is switched an even number of times it will be back where it started, i.e. closed. So lockers whose number has an even number of factors will end up closed. Conversely lockers whose number has an odd number of factors will be switched an odd number of times and end up open.
Which numbers have an odd number of factors? As a rule factors occur in pairs of distinct numbers; for example
6 = 1 x 6 = 6 x 1
6 = 2 x 3 = 3 x 2
However the exception are square numbers, which by definition have a factor (the root of the square) which is not one of a distinct pair. For example
9 = 1 x 9 = 9 x 1
9 = 3 x 3
Square numbers, and only square numbers, have an odd number of factors. So we conclude that the lockers that are open at the end are just those numbered 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100.