Let $\mathbb{S}$ be the Sierpinski space, that is $\mathbb{S}$ has $\{0,1\}$ as a base set, and $\tau = \{\emptyset, \{0\}, \{0,1\}\}$ as a topology.
The Sierpinski space $\mathbb{S}$ has the following property:
$(\star)$ Given any topological spaces $X,Y$ and a function $f:X\to Y$, then $f$ is continuous if for every continuous map $z:Y\to \mathbb{S}$ the map $z\circ f: X\to\mathbb{S}$ is continuous.
(Proof. If $f: X\to Y$ is not continuous, then there is $V\subseteq Y$ open such that $f^{-1}(V)$ is not open in $X$. Defining $z_V: Y\to \mathbb{S}$ as mapping $V$ to $0$ and $Y\setminus V$ to $1$ we immediately see that $z_V\circ f: X \to Z$ is not continuous.)
If a topological space $S$ has property $(\star)$ then we call it Sierpinski-like. (Maybe there is some standard terminology, but I wasn't able to find it.)
Soft question: How can Sierpinski-like spaces be characterized?
Concrete question: Do Sierpinski-like spaces have to be $T_0$? Or do they necessarily contain a non-empty open set $U_0$ such that $U_0\subseteq U$ for all open non-empty $U$?