Why does my bike stick in low gears? When I change into a low gear (i.e. onto a bigger cog) on my back cog all is fine. However, when I later change up again the chain sticks on the larger cog. I commute about 10 miles a day and this has been happening now for about 3 days. It usually rectifies itself after a period of frantic pedalling. I'm riding a fairly old (2004ish) Specialized Rock Hopper (in good nick) with road tyres.
My thoughts are that this is being caused by either the gear cable sticking somewhere or by a problem in the derailleur.
Any tips on how to diagnose where the problem lies? I guess I could just get a new cable and see if this fixes it.
Thanks!
What is happening is that you have enough force in your hand to move the whole mechanism towards one direction overcoming the failure point, but the spring in the derailleur doesn't have the required force. As you pedal (and ride) vibration helps momentarily reducing friction and allowing the spring to pull back, so it finally shifts.

The most common cause of this issue is rust between the cable and the cable housing. There are also a few other closely related: 


Dirt can accumulate inside the cable housing.
The lubricant used on the cable (if any) gets clogged or dries up, also catching dirt.
The lining of the cable housing or inner of the housing itself has
degraded due to wear.
The cable is deformed or frayed inside the housing.


All of the previous are cable related and can be easily diagnosed by disassembling the cable, pulling it out of the housing and visually check the cable. It should look even, without rust and without any permanent sharp bends, i.e. if left hanging it should hang straight or barely and smoothly curved. Also you should be able to pull and push cable in and out of the housing wit almost zero effort (no "perceptible" friction).

The easy way to fix is to replace the cable and the housing. If this is not an option you can clean the cable, try to unbend it, lubricate and reassembly. Frayed cable can be reused by removing the hole strand of wire up to the head of the cable. The cable can survive with one or two strands out. But all these are temporary remedies only, you will quickly observe the symptoms again, specially with frayed cable, chances are it will fray more. Very old cable or too rusted is better not to attempt any of these solutions as they wont last enough to be worthy.

Also remember to clean the housing internally. This can be achieved pouring rust remover or fine oil inside the housing and hope it will get out by the other end dragging the dirt and debris out. This can be messy and time consuming.  If you can blow through it with an air compressor, it may help if the problem is just trapped dirt.

But then again, these are temporary solutions,as most of the time, the housing will be damaged on the inside, due to wear, and this causes rough spots that easily trap more dirt or simply cause friction, so the whole system wont perform as good as with simple brand new cable.

A badly installed cable can also be the cause. Check the hole travel of the cable looking for sharp turns, or the cable being pulled against parts of the frame or components or accessories where it is not supposed to.

If all the previous is verified and corrected as needed but the problem persists, the derailleur itself must be checked. Here the most common causes can be:


Too much dirt trapped among derailleur's linkages
The derailleur is badly bent or otherwise has lost its shape.
There is rust in the pivots
weakened spring due to rust, deformation or excessive wear, or even misplaced spring


All these can be diagnosed for sure with close and careful visual inspection under good light. Nevertheless to be sure you can disconnect the cable, remove the chain and carefully move the derailleur along its designed travel. You should feel clear resistance from the spring and the mechanism should quickly return on itself when you release it. If it presents lag in the return, re-check the above.

The obvious solutions are clean the derailleur and lubricate it's pivots. In case of a misplaced spring, it can be relocated using long fine nose pliers, just be careful. If the spring is too damaged, maybe is better to change the derailleur or try to find a spare spring somewhere, if it's free, better.

If the derailleur is bend or otherwise deformed, you better get another one. Almost only steel ones can be rectified but it is rather difficult and time consuming, it's not worthy most of the time since steel derailleurs tend to be cheap.

Do not forget to inspect and test the shifter lever. The easy way is to disconnect the cable from the derailleur and while gently pulling it outwards the housing, actuate the lever back and forth. The cable should move accordingly. If the shifter is the indexed type, the cable movement should be crisp and without lag. Generally, the lever just needs some lubrication. I do not recommend dis assembly of indexed shifter levers as many are rather complex.

When you finish reassembling the system most sure you'll need to adjust derailleur properly. Sure you'll find lots of methods/tutorials in the cloud or in other questions posted on this site.

If any of the above help you diagnose the problem better take your bike to a local shop.