I would approach the problem like this:
f[x_] := x^3 - p x^2 + q x - r
Now try
Solve[{f[x]==0, f'[x]==0}, x]
which returns {}
meaning that there are no solutions. More specifically it means that there are no solutions for arbitraryp
, q
and r
, but there might be solutions if these parameters satisfy certain conditions. We can ask Mathematica to generate those conditions:
Solve[{f[x] == 0, f'[x] == 0}, x, MaxExtraConditions -> Infinity]{{x -> ConditionalExpression[p/3, p^2 - 3 q == 0 && p^3 - 27 r == 0]}, {x -> ConditionalExpression[p/3, p^2 - 3 q == 0 && p^3 - 27 r == 0]}, {x -> ConditionalExpression[(p q - 9 r)/(2 (p^2 - 3 q)), -p^2 q^2 + 4 q^3 + 4 p^3 r - 18 p q r + 27 r^2 == 0]}}