Knee replacements would be virtually unnecessary if people would stop forcing their joints do what their muscles were intended to do, but hey, in order to do that you'd actually have to have some muscle, right?
Our joints —all of them— are simply hinges. No joint in your body was meant to bear weight or act as a shock absorber or brake. Yet 95% of all people are so weak from muscle atrophy that they must stress the joints to accomplish any given task.
If your knees hurt when climbing stairs it's because you are not using your butt muscles or your quadriceps and hamstrings efficiently to do the work of propelling your body up those stairs.
Watching most people perform squats or leg presses at the gym makes me cringe because of the extreme and completely unnecessary and counter-productive stress they are putting on their hinges.
If your elbows, shoulders, knees etc. hurt at the gym, it's because you are doing your exercises wrong. Flex your muscles immediately before commencing the movement, and keep them flexed throughout. This takes concentration, so block out whatever is happening around you.