Let $f(x) = e^{-x^2}$ and $A= \mathbb{R}$.
Then $f(\mathbb{R}) = (0,1]$ which is neither open nor closed. $A$ is both open and closed.
Let $f(x) = e^{-x^2}$ and $A= \mathbb{R}$.
Then $f(\mathbb{R}) = (0,1]$ which is neither open nor closed. $A$ is both open and closed.