g[x_] := Sqrt[x];
p0 = 0.1;
xMin = 0;
xMax =2;
nIterations =5;
(* Make changes only above this line *)
path = {};
iterates = {p0};  (* this will give the seqence of iterates *)
p = p0;  (* p is always the current p_n, p0 is unchanged *)
Do[
newp = g[p];
iterates = Join[iterates, {newp}];
path = Join[path, {{p,p},{p, newp}, {newp, newp}}];
p = newp,
{nIterations}  (*Do it this many times *)
];
Plot[{g[x], x}, {x, xMin, xMax}, AspectRatio -> Automatic (* y = x is 45° degree line *), PlotStyle ->{Automatic, Dotted}, Epilog -> {PointSize[Large],Point[{p0, p0}],Line[path]}
]
iterates