The problem is that exponentiation with a float exponent is only defined for a strictly positive non-negative base:
julia> f(0.5) # involving (-0.5)^(2/3)
ERROR: DomainError with -0.5:
Exponentiation yielding a complex result requires a complex argument.
Replace x^y with (x+0im)^y, Complex(x)^y, or similar.
...
If you just rewrite f as
f(x) = (1/(x-1)^2)^(1/3)
then you won’t run into any issues.
