If $f$ verifies the desired propery, its restriction $f|_{[n,n+1]}$ gives a continuous function on $[n,n+1]$ that is zero on the edges of the interval, for any $n \in \mathbb{Z}$. Reciprocally, if we have $f_n : [n,n+1] \to \mathbb{R}$ continuous with $f_n(n) = f_n(n+1) = 0$ for each integer $n$, by the gluing lemma this gives a continuous function $f: \mathbb{R} \to \mathbb{R}$ with $f(n) = f_n(n) = 0$. This means that we can approach the problem somewhat 'locally', i.e. we can fix an interval $[n,n+1]$. Now, the function
$$
f_n (t) = \mu_n\sin(\pi(t-n))
$$
takes values on $\mu_n[-1,1] = [-\mu_n,\mu_n]$ and $f_n(n) = f_n(n+1) = 0$. Thus, the family $(f_n)_n$ induces a continuous function $f$ that vanishes at $\mathbb{Z}$ and
$$
f(\mathbb{R}) = \bigcup_{n \in \mathbb{Z}} f_n([n,n+1]) = \bigcup_{n \in \mathbb{Z}}[-\mu_n,\mu_n]
$$
so the problem reduces to choosing a sequence $(\mu_n)_n$ so that the former union is open. One possible choice is $\mu_n = 1-\frac{1}{|n|}$ so that
$$
f(\mathbb{R}) = \bigcup_{n\in \mathbb{Z}}[-\mu_n,\mu_n] = \bigcup_{n\in \mathbb{N}}[-1+\frac{1}{n},1-\frac{1}{n}] = (-1,1).
$$