In a recent assignment of mine at university I proved the following proposition;
Let $(V,||.||_V)$ and $(W,||.||_W)$ be two normed vector spaces and $f:V \rightarrow W$ a function. Under these hypothesis, $f$ is continuous if, and only if, the pre-image of every open set $U \subseteq W$ is also open.
Now I have proven this proposition (both directions), and my proof has convinced me. However when trying to prove this I came up with the following;
Consider the piece-wise function $f: (0,6) \rightarrow (0,4)$ defined by
$$ f(x) = \begin{cases} x^2, &0 <x<2\\ \frac{-1}{2}x+3 & 2\leq x <6 \end{cases} $$
which is obviously discontinuous only at $x=2$. However if $U = (0,4)$ then $f^{-1}(U) = (0,6)$, both of which are open sets, but $f$ is not continuous. Thus we contradict the proposition.
Obviously there is a flaw in my logic somewhere or I have misunderstood the proposition. So I put it to you to point out the error or misunderstanding.
The preimage must be open for all open sets.
The preimage of $(0,3)$ is not open, so the function is not continuous.