How should I add a rail on a carpeted stairway that's open on one side?
You'll have to cut the carpet to attach the railing properly. Go grab the latest newstand issue of Fine Homebuilding. They have a full article on it:



(Not affiliated with the magazine in any-way other than I am a fan and find it to be the best construction magazine out there) 

Also, heads up that this will likely be caught on an inspection and/or appraisal. The current homeowners may be required to do this to even get a mortgage approved.