In fact, if $g:[a.b]\longrightarrow[a,b]$ is continuous your required divergence for any initial point is impossible because $g$ will have at least fixed point $p$ and $p = g(p) = g(g(p)) = \cdots$
EDIT:
Lat be $F$ the set of fixed points of $g$ and $E =\bigcup_{n=1}^\infty g^{-n}(F)$. If all the fixed points of $g$ are repelling (for all $p\in F$, $|g'(x)| > 1$ for all $x$ in a neighborhood of $p$), then for any $x_0\in[a,b]\setminus E$, the sequence $x_0$, $g(x_0)$, $g(g(x_0))$, $\dots$ diverges.
Proof: Suppose $(x_n) = (g^n(x_0))$ converges. Only can converge to some fixed point $p$. Let be $(p-\epsilon,p+\epsilon)$ a repelling neighborhood. Then, for some $n$, $x_n,x_{n+1}\in(p-\epsilon,p+\epsilon)$ with $p<x_{n+1}<x_n$ or $x_n<x_{n+1}<p$. Then, by the MVT
$$|x_{n+1} - p| = |g(x_n) - g(p)| = |g'(\xi)(x_n - p)| > |x_n - p|,$$
contradiction.
To get the solution to converge, besides $g(x)=x$ you need $|g'(x)| \lt 1$ at the root. The distance from the root is multiplied by about $|g'(x)|$ every iteration, so if that is less than $1$ it will converge. Powers change quickly and roots slowly, so a natural try is to write
$$x^4 +2x^3 -5x^2 -7x-5=0\\x^4=-2x^3+5x^2+7x+5\\
x=\sqrt[4]{-2x^3+5x^2+7x+5}$$
It converges nicely starting at $0, 1$ and $3.5$ but fails starting from $4$ because the piece under the root goes negative. Another try, which I have not tested, would be to write $$x^4 +2x^3 -5x^2 -7x-5=0\\x^4=-2x^3+5x^2+7x+5\\
x=(-2x^3+5x^2+7x+5)/x^3$$ It is a bit of an art. If you don't know the root, you can't evaluate the derivative of your proposed $g(x)$ at it.
Best Answer
There is a theorem called Banach Fixed point theorem which proves the convergence of a fixed point iteration.
Definition. Let (X, d) be a metric space. Then a map T : X → X is called a contraction mapping on X if there exists q ∈ [0, 1) such that
for all x, y in X.
Banach Fixed Point Theorem. Let (X, d) be a non-empty complete metric space with a contraction mapping T : X → X. Then T admits a unique fixed-point x* in X $(i.e. T(x^*) = x^*)$. Furthermore, x* can be found as follows: start with an arbitrary element $x_0$ in X and define a sequence $\left\{ x_n \right\}$ by $x_n = T(x_n−1)$, then $x_n → x^*$.
One of the big challenges is to actually find a map T : X → X that satisfies this criteria. For 1D systems, Newton's method satisfies only for a small section of the real-line. It is for this reason you need to start very close to the solution to get to the answer.