How many switches are ON
Python, 19 characters
f=lambda n:n**.5//1

Perfect squares are the only numbers with an odd number of divisors.
This used to be a 21-character answer:
f=lambda n:int(n**.5)

but since I originally wrote it in 2011, the floor-division // operator was introduced, which can replace the int call.
As a consequence, the answer is now returned as a floating-point number. (But f(10) == 3.0 is still a correct number of lockers!)