It depends where it is. Which leg seems to be off? Is it his front leg or his hind leg? He could need more stretch work done, he's also pretty young to be working hard, also. You should consider giving him a good week break. He doesn't need ridden if he's hurt! You're only making it worse. Imagine if you twisted and pulled your ankle and someone went 'keep going keep going' you wouldn't be happy.
He does need some exercise, hand walking and trotting is a good option. You need to contact a vet if you cannot find out what's going on. Run your hands down their legs, is there any swelling or heat? If so, that's your area that's in pain. Do the tendons feel inflamed? If there is no sign of pain in the legs... look further. Lets pretend it's in his left shoulder (since you don't say) and so a good way to see what's going on is to lift his leg, and gently stretch it forward. You are checking the shoulder. set it down and have him walk off, is it apparent now? Pick it up again and stretch it back, then have him walked off again, how about now? If it's in the shoulder, you can do a stretch regiment along with massage and liniment (not recommended unless you've been trained, since it can't guarantee he'll be alright) or you can contact the vet.
I'd say, contact your veterinarian and have them come out and see what's going on. If it's been going on for a month, he's got some form of stiffness in his body. I doubt it's a stone bruise unless he continually keeps hurting his feet. Pick up his feet, are they sore? Does he pull away when pressure is put on different parts of his feet?
Seriously, though, the only way you can be certain to not really hurt the horse is to call a vet.
Edit: Holy cow, I got it right... that's creepy.
Anyway, before you ride him from now on, set out a regimen of stretching him. See if this improves his movements. Do NOT continue riding him if he appears as though he is sore. Since he's only doing it a little, go ahead and try doing this first and if it helps, then don't worry too much about the vet just yet -- if it doesn't, contact your vet.
This is a stretching routine for your horse. Pick up your horses left (and you will do it on the right leg also) front and gently stretch it forward so that it rests on the ground and forward, hold it until he steps into it. You may have to have someone gently encourage him to step forward, when he does step onto it, step back and let him stand for as long as he holds the stretch. Most horses when first starting this quickly return to a standing position because their muscles are sore and they cannot hold the stretch. Do this another time so that he stretches into it properly. My horses now will step into the stretch and hold it until they're content, returning back to a standing position, licking and chewing their lips (or sighing, which shows relaxation). Then, pick back up the hoof and step it out gently to the side, not a huge seperation but enough that the horse is stretching the middle of the chest. THEN after stretching the horse like this, pick the hoof up again (let the horse stand that way for as long as he likes, if he wants to hold the stretch, let him!) and stretch the leg backwards, setting it back down so that he puts weight on it. If he quickly returns his foot to the way it was before, do it again but don't put it back as far and if he seems like it's nothing, try stretching it just a bit further back. Do the same on the other side. You can repeat this also with the back legs, then warm up with a nice long fast walk that requires him to really stretch out (when riding) and then pick up the trot, see if this doesn't help.
If it does, he should be fine.
Also: does he stumble/seem sore when you're trotting him in hand? Have someone trot him and watch him. See if these things don't help, if there isn't any swelling the pain is either in the hoof or the shoulder. Also look at the hoof, is he walking on a lot of frog? Does he seem sore anywhere in the foot, are their any rocks? Pick it out very well. Sounds like he could have a stiff shoulder or a pulled muscle. Stretching = your friend. Also, never keep riding him if he seems sore, just do a nice long walk, get off, stretch, walk him some more, do some hand trotting and see how he is doing.
Good luck.