Let you have a function and an initial point
f[x_] := Cos[x]
x0 = 0.2;
Then you can calculate a sequence
seq = NestList[f, x0, 10]
(* {0.2, 0.980067, 0.556967, 0.848862, 0.660838, 0.789478, \
0.704216, 0.76212, 0.723374, 0.749577, 0.731977} *)
and vizualize it with a so-called Cobweb plot
p = Join @@ ({{#, #}, {##}} & @@@ Partition[seq, 2, 1]);
Plot[{f[x], x}, {x, 0, π/2}, AspectRatio -> Automatic,
Epilog -> {Thick, Opacity[0.6], Line[p]}]

The same for f[x_] := 2x

The logistic map:
logistic[α_, x0_] := Module[{f},
f[x_] := α x (1 - x);
seq = NestList[f, x0, 100];
p = Join @@ ({{#, #}, {##}} & @@@ Partition[seq, 2, 1]);
Plot[{f[x], x}, {x, 0, 1}, PlotRange -> {0, 1},
Epilog -> {Thick, Opacity[0.6], Line[p]}, ImageSize -> 500]];
t = Table[logistic[α, 0.2], {α, 1, 4, 0.01}];
SetDirectory@NotebookDirectory[];
Export["logistic.gif", t];

RSolve
and thenScope
. – Sektor 13 hours ago