For a given interval $(a,b)$, whre $a,b\in \mathbb{N}$, is it possible to define a function such that $a<f(n)<b$, for any positive integer $n$.
For example, $0<\dfrac{n}{2^n}<1$ for all integers $n$($>0$).
Updated:
I would like to define $f$ like this way :
$f(n)=\phi(n,a,b)$, where $a,b$ are given in advance and $n\in \mathbb{N}$, i.e., in the definition of $f(n)$, $n$ will present as well as $a,b$.
Sure, and you've given the answer right there. As you say $0 < \frac {n}{2^n} < 1$. Note also that we must have $b \geq a+1$. So, $a < a + \frac{n}{2^n} < a+1 \leq b$. So, given such a pair $a,b \in \mathbb{N}$, if you define $f(n) = a + \frac{n}{2^n}$, then it will have that property.