Several possibilities:
1) Broken cable, where cable enters mouse.
If the optical mouse is wireless, check for bad batteries,
interfering sources (telephone base station), or for
interference coming from a neighbor.
I've had a few cables go bad. I pull a hunk of cable inside
the mouse, cut off the defective wire, and solder the wires
back into place. The strain relief they use, only helps a bit.
If you need proof, you can use a multimeter and do a continuity
check, with the mouse opened up, and the wire pads exposed.
2) If you look at the quality of the sensor,
they're typically dreadful looking. It's a wonder
they hold together. The people making those sensors,
can't seem to make a good housing for the IC.
3) Check for dust and dirt. I might average a year or
two, between mouse disassemblies. Note that, the mouse
can be filled with bits and pieces, like tiny springs.
Work on a brightly lit surface, so you don't lose anything.
I can't imagine the sweatshop where they'd assemble such
things (lots of small parts, doesn't suggest automation is
used). I'm really surprised there isn't a way to make
the mouse less labor-intensive in manufacturing.
Most of the time, I need to clean the scroll wheel
sensor area, and remove dust balls from underneath the
mouse buttons. I haven't needed to do anything special
with the sensor.
The screws are typically hidden by stickers, or by the
sliders on the bottom of the mouse. You can use a magnet,
sweep it over the base of the mouse, to get some idea where
the screws are located.
I would rate "broken cable", high on my list. Dust bunnies
under the buttons, you can tell by the accidental "drop" on
a "drag", that the button needs cleaning. Or just the feel
of the buttons isn't right.
At one time, the optical sensors could be fooled by a particularly
bad choice of mouse pad. I use a rubber pad now (from a
company that knows how to make rubber that doesn't stink
).
The sensor seems to work well on that.
Paul