# $f:A\rightarrow B$ and $a_n=f(a_{n-1})$ $L=[a_1,a_2,…a_n,…]$ For which $f$ and $a_0$ is $\bar L=B$?

This is a generalization of a question I posted a few days ago regarding a particular recursive sequence .

I am trying to find general conditions (if they do exist) on which the problem has a definitive answer. The excellent answer provided by user "rtybase", I believe gives a few hints on these conditions but I have been unable to extrapolate something concrete.

So, the more general question is:

Let $f:A\rightarrow B$ with $A,B \subset \Bbb{R}$ be a continuous function and $a_n=f(a_{n-1})$ a sequence, $a_n: \Bbb{N}\rightarrow L=[a_1,a_2,...a_n,...]$. For which $f$ can we chose an $a_0$ such that $L$ is dense in $B$, i.e. $\bar L=B$?

As noted in the answer provided for the particular case of $f(x)=\cos x$, $f$ cannot satisfy the equation $f(x_0)=x_0$, for if it does, then $a_n\rightarrow b$ and $L$ is thus a converging sequence. So, $f$ cannot have a fixed point in $A$, and as such, $f$ cannot be a contraction because of Banach's Fixed Point Theorem. And in general, $f$ cannot satisfy any fixed-point theorem.

What other properties should an appropriate $f$ have in order to satisfy $\bar L=B$?