# Finding a continuous function $f: \mathbb{R} \to \mathbb{R}$ such that $f(\mathbb{R})$ is neither open nor closed

Find a bounded, continuous function $f: \mathbb{R} \to \mathbb{R}$ such that $f(\mathbb{R})$ is neither open nor closed?

• I see no questions, just an order. Unless you contribute some of your ideas to the post, this is likely to be closed. May 3, 2013 at 21:01
• @rschwieb Not a question: "Derive the quadratic formula." $\mapsto$ Question: "Derive the quadratic formula?" May 3, 2013 at 21:35
• @tacos_tacos_tacos ERight :) What could would a question mark be if it didn't transform any string of letters into a question? May 4, 2013 at 1:18

Take $f(x):=e^{-x^2}$: it's a continuous bounded function on the real line, and $f(\Bbb R)=(0,1]$, which is neither open nor closed.
Let $f:\mathbb{R}\rightarrow\mathbb{R}$ be defined as $f(x)=\frac{x^2}{x^2+1}$. You have that $f(\mathbb{R})=[0,1)$ which is neither open nor closed.
Take $f(x) = \arctan(x^2)$. Then, $f(\mathbb{R}) = [0, \pi/2)$.
Take $f(x)$ to be $f(x)= \begin{cases} \dfrac{1}{x^2}, \ x\not\in [-1,1], \\ \\ \\ 1 \ \ \ \ , x\in[-1,1] \end{cases}$. Is $f$ continuous? Bounded? What is $f(\mathbb R)$?