Input := g[x_] = 2.7 x (1 - x); x0 = 0.45; n = 6;
Create a list of Points on the Orbit Diagram
Input :=
pts = Table[0, {i, 1, 2n + 1}];
pts[[1]] = {x0, g[x0]};
Do[x0 = g[x0];
pts[[i]] = {x0, x0};
pts[[i + 1]] = {x0, g[x0]},
{i, 2, 2 n, 2}];
Plot the Points
Input := iterateplot = ListPlot[pts, PlotJoined -> True, DisplayFunction -> Identity];
Plot the Map along with the Replacement Line
Input :=
mapplot = Plot[{x, g[x]}, {x, 0, 1},
PlotStyle -> {AbsoluteThickness[1],
AbsoluteThickness[2]},
AspectRatio -> Automatic,
PlotRange -> {0, 1},
DisplayFunction -> Identity];
Plot the Orbit Diagram
Input :=
Show[iterateplot, mapplot,
AspectRatio -> Automatic,
PlotRange -> {{0, 1}, {0, 1}},
DisplayFunction -> $DisplayFunction]

The orbit started at x = 0.45 and is spiraling towards the origin.