Where the pivot is for the peg. Remove the cotter pin from the bottom side. Slide the shaft out being carful not to lose the spring. Then the whole peg will come off
You can stick a plug in it to take it to the shop for replacement. Ive done it and it was farther than 10 miles.
Like everyone else has said replacing both is the best plan and a great upgrade from the stock bricks that are called tires
check for scratches and/or gouges on the sides of the engine, grab handles, bar ends and frame. Thats a give away that it was dropped. Also it shouldnt be greasy a little road gunk is one thing but if its really oily and greasy thats not good