Question:
Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a continuous function. For every $A\subset\mathbb{R}$ open, prove that if $f(A)$ is open, then $f$ is injective.
My attempt:
We prove the contrapositve. We exibit an open set $A$ such that $f(A)$ is not open. We have that $f$ is not injective. Hence, there exists $x,y\in\mathbb{R},x\neq y$, such that $f(x)=f(y)$. Take $A=(x,y)$. We notice that A is an open set. Since $f$ is continuous, it follows that $f(A)$ is an interval. We argue that $f(A)$ cannot be an open interval since, this would force $f(A)=(f(x),f(y))$ or $f(A)=(f(y),(f(x))$, both of them being the empty set (which is not an interval).
Hence, since an interval is an open set iff it is an open interval, we conclude that $f(A)$ cannot be open.
Why i posted this question: since $x$ and $y$ are not in $A$, the only way to the image of $f(A)$ to be open, that is, for the extremes of this interval don't be part of it, is: $f(A)$ must have $f(x)$ and $f(y)$ as its extremes. Is this reasoning correct? Any counter example?