Consider the map $f:\mathbb{R}\to \mathbb{R}$ given by $f :x \mapsto \frac{x^2}{x^2+1}$Then $f(\mathbb{R})=[0,1)$ which is neither closed nor open whereas $\mathbb{R}$ is both open and closed.