Clarification on the topological definition of continuity We have the standard topological definition of continuity as:

For topological spaces, $(X,\tau_x)$ and $(Y,\tau_y)$, a function $f : X \rightarrow Y$ is continuous if $\forall V \in \tau_Y$, $f^{-1}(V) \in \tau_X$.

I was presented with a similar property, namely:

Let $f : X \rightarrow Y$, where $\forall U \subseteq X$, $f(U) \in \tau_Y$ implies $U \in \tau_X$

How is this different from the definition of continuity? It seems to me that the property above starts from the domain into the range, while continuity is the reverse. Perhaps, could anyone show me examples of $f$ that is continuous but the property does not hold, and vice versa?
 A: Let $Y$ be a singleton. 
Then every function $f:X\to Y$ is continuous (no matter what topology we have on $X$). 
However the existence of a function $f:X\to Y$ that has the second property implies that $X$ is equipped with the discrete topology. If so then moreover every function $X\to Y$ will have the second property.

edit
Let $X=\{1,2\}$, $Y=\{0,1,2\}$ and let $f:X\to Y$ be prescribed by $x\mapsto x$.
Let $\tau_X=\{\varnothing,\{1,2\}\}$ and let $\tau_Y=\{\varnothing,\{0,1\},\{0,1,2\}\}$.
Then $f$ is not continuous, because $f^{-1}(\{0,1\})=\{1\}$ is not open in $X$.
On the other hand $f$ satisfies the second property.
A: Let $\vert \cdot \vert$ be the standard norm on $\mathbb{R}$. We denote by $(\mathbb{R}, \vert \cdot \vert)$ the topological space, where the topology is induced by the norm.
Let $f: (\mathbb{R}, \{ \emptyset,  \mathbb{R} \}) \rightarrow (\mathbb{R}, \vert \cdot \vert), \ f(x)=sgn(x)$ is not continuous, but it fulfills the second property (as $f(U)$ is open in the norm topology iff $U=\emptyset$). Note that this map is not open, as $f(\mathbb{R})=\{-1, 0, 1 \}$ is not open in the norm topology (i.e. the second property does not coincide with being an open map).
On the other hand, the map $g: (\mathbb{R}, \vert \cdot \vert) \rightarrow (\mathbb{R}, \vert \cdot \vert), \ g(x)=x^2$ is continuous, but it does not fulfill the second property. Namely
$$ g([-1,0) \cup [1, 2))=(0,4) $$
is open, but $ [-1,0) \cup [1, 2)$ isn't.
