Suppose $X$ is a compact Hausdorff space, $Y$ is a compact $T_1$ space and $f\colon X\to Y$ has the property that for every $T_3$ space $Z$ and every continuous $g\colon Y\to Z$, the composition $g\circ f$ is continuous.
Can we conclude that $f$ itself is continuous?
If $Y$ was allowed to be more pathological, the answer would no: for example, if we take for $Y$ the Sierpiński two-point space (which is compact and $T_0$), then any continuous function from $Y$ to a $T_3$ (even $T_1$) space is constant, so the assumption is trivially satisfied for any function $f$, which means that in particular, we can take an $f$ which maps a non-closed set to the closed point, and its complement to the open point, and then the conclusion fails.