I'm using a very simple numerical method to find solutions to an equation. Start with an equation $\operatorname{f}(x)=0$ that you need to solve. Rearrange to give $x=\operatorname{g}(x)$ and then use the recurrence relation $x_{n+1} = \operatorname{g}(x_n)$ to hopefully tend towards a solution.
I'm trying to find an interesting example where starting with $x_0 < \ell$, but very close to $\ell$, gives a sequences tending towards one limit, while starting with $x_0 > \ell$, but very close to $\ell$, gives another. (Where $\operatorname{f}(\ell) \neq 0)$ I can find unintesting examples where negative $x_0$ gives a negative limit and positive $x_0$ gives a positive limit.
Can anyone suggest an interesting example. For example, for some $x_0 > 2$, very close to $2$. gives a sequence tending towards a negative limit and for some $x_0 < 2$, very close to $2$ gives a sequence tending towards a positive limit.
EDIT: I am looking for a single, smooth function $\operatorname{g}$. I want a good old-fashioned elementary function. If possible, a polynomial or rational function would be great.