I have read that in Candy Box 1, you may buy "Surpass yourself" in order to defeat yourself. My question is, there is no option to buy that; so how do you beat yourself?
In Candy Box 2, to defeat yourself, you need two things.
First, you need an X Potion to begin the encounter. This is brewed in the cauldron by solving the riddle in the potion book.
The second thing you need is the Octopus King's Crown, earned by defeating an Octopus king in the mountain, which gives you self confidence. This needs to be the unenchanted version- the enchanted versions will not work.
If you fight yourself while wearing the Octopus King's Crown, you can defeat yourself.