The correct option is D John, a stupid boy, lived to regret his stupidity.
Two noun phrases put side by side in a clause to describe the same person or thing is called apposition. Here, John and "a stupid boy" refer to the same person. Hence, Option A is correct. The rest of the options do not adhere to the goal, hence incorrect.