Reading this will get you started:
One Dimensional Dynamical Systems
Emergence of Chaos from Interactive Mathematics Miscellany and Puzzles
Why is it that we can start with a number (say, 1), and press cos x repeatedly, we can get the solution of cos x = x?
e.g. cos (1) = 0.54
cos (0.54) = 0.85
cos (0.85) = 0.65
cos (0.65) = 0.79
cos (0.79) = 0.71
cos (0.71) = 0.76
cos (0.76) = 0.72
.....
until it converges to 0.73
Reading this will get you started:
One Dimensional Dynamical Systems
Emergence of Chaos from Interactive Mathematics Miscellany and Puzzles
This is called Picard's Method (to find roots in R).
It can also be applied to other functions.
If you start with a positive x value, it'll diverge. But a negative initial value will diverge to zero. You can also change the function to to make it diverge for positive x values.