You can use \pgfmathparse
(or \pgfmathsetmacro
as below) to recursively compute your function as you run through the pgf \foreach
loop. of course, you need to "save" the previous value as you go.
Your question seems to be using both the functions x(4-x)
and x(4-x)/2
, so I have stuck with the first one. It's very sensitive on the initial value of course:

Here is the code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,decorations.markings}
\tikzset{% style to put arrow head in middle of line
->-/.style={decoration={markings, mark=at position 0.5 with {\arrow{stealth}}},
postaction={decorate}},
}
\begin{document}
\begin{tikzpicture}
\draw[thin,->] (0,0) -- (4.5,0);
\draw[thin,->] (0,0) -- (0,4.5);
\draw[dashed] (0,0) -- (4,4);
\draw[blue,thick,smooth,samples=100,domain=0:4] plot(\x,{(\x)*(4.0-(\x))});
\def\fn{0.2}% initial value
\draw[dashed](\fn,0)node[below=1mm]{$\fn$}--(\fn,\fn);
\foreach \n in {1,...,8} {
\pgfmathsetmacro\fnn{\fn*(4-\fn)}% compute the next value
\draw[dotted,->-](\fn,\fn)--(\fn,\fnn);
\draw[dotted,->-](\fn,\fnn)--(\fnn,\fnn);
\xdef\fn{\fnn}% save value - need \xdef to force expansion
}
\end{tikzpicture}
\end{document}