$p$ is the initial price per dozen
If candies costed $x$ cent less per dozen, the total cost is $\dfrac{x+3}{12}\left(p-x\right)$
If candies costed $x$ cent more per dozen it is $\dfrac{x+3}{12}\left(p+x\right)$
The problem says that in the first case the cost is $3$ cents less so we have the equation
$$\frac{x+3}{12}(p-x)=\frac{x+3}{12}(p+x)-3$$ Least common denominator $$(x+3) (p-x)=(x+3) (p+x)-36$$ Expand $$p x+3 p-x^2-3 x=p x+3 p+x^2+3 x-36$$ move everything in the RHS
$2 x^2+6 x-36=0$ simplify dividing all by $2$
$x^2+3x-18=0$ which gives $x_1=-6;\;x_2=3$
The actual solution is $x=3$