\documentclass{article}
\usepackage{tikz}


\begin{document}

%3.569946 onset of chaos
%3 period 2 cicle is born
%2.5 damped oscillation to fixed point
%1.5 monotonically toward fixed point
% periodic window start 3.83
\def\a{3.7}
%\def\a{3.1}
%\def\a{3.5}
\def\xzero{0.2}
%\def\niter{3}
%\def\niter{10}
\def\niter{100}
\begin{center}
\begin{tikzpicture}[domain=0:1,scale=5]
  \draw[thick] (0,0) rectangle (1,1);
  \draw (0,0) node[below left] {$0$} --  node[below] {$x_n$} (1,0) node[below] {$1$};
  \draw (0,0) -- node[left] {$x_{n+1}$} (0,1) node[left] {$1$};
  \draw[color=red]  plot (\x,\x);
  \draw[color=blue,very thick] plot (\x,{\a * \x * (1-\x)});
  \let\x=\xzero
  \pgfmathparse{\a *\x*(1-\x)}
  \let\y=\pgfmathresult

  \draw[color=green,thick] (\x,0) node[below]{$x_0$} -- (\x, \y) circle(.1mm); 
  \foreach \i in {1,...,\niter} {
     \draw[color=green,thick] (\x, \y) -- (\y, \y) circle(.1mm);
     \global\let\x=\y
     \pgfmathparse{\a *\x*(1-\x)}
     \global\let\y=\pgfmathresult
    \draw[color=green,thick] (\x, \x) -- (\x, \y) circle(.1mm); 
  }
\end{tikzpicture}
\par
\niter{} iterazioni con $a=\a$, $x_0=\xzero$
\end{center}

\def\niter{100}
\begin{center}
\begin{tikzpicture}[xscale=.1]
  \draw[thick, ->] (0,0) --  node[below] {$n$} (\niter+1,0);
  \draw [thick, ->](0,0) -- node[left] {$x_n$} (0,1.1) ;
  \let\x=\xzero
%  \node[below]{$x_0$} at (0 \x); 
  \foreach \i in {1,...,\niter} {
     \pgfmathparse{\a *\x*(1-\x)}
     \global\let\y=\pgfmathresult
     \draw[color=green,thick] (\i-1,\x) -- (\i, \y) circle (.1mm);
     \global\let\x=\y
  }
\end{tikzpicture}
\par
\niter{} iterazioni con $a=\a$, $x_0=\xzero$
\end{center}

\end{document}