  A function $f:X\to \mathbb R$ defined on a topological space $X$ is called
returning if for any point $x\in X$ there exists a positive real number $M_x$
such that for every path-connected subset $C_x\subset X$ containing the point
$x$ and any $y\in C_x\setminus\{x\}$ there exists a point $z\in
C_x\setminus\{x,y\}$ such that $|f(z)|\le \max\{M_x,|f(y)|\}$. A topological
space $X$ is called path-inductive if a subset $U\subset X$ is open if and only
if for any path $\gamma:[0,1]\to X$ the preimage $\gamma^{-1}(U)$ is open in
$[0,1]$. The class of path-inductive spaces includes all first-countable
locally path-connected spaces and all sequential locally contractible space.
  We prove that a function $f:X\to \mathbb R$ defined on a path-inductive space
$X$ is continuous if and only of it is returning and has closed graph. This
implies that a (weakly) \'Swi\c atkowski function $f:\mathbb R\to\mathbb R$ is
continuous if and only if it has closed graph, which answers a problem of
Maliszewski, inscibed to Lviv Scottish Book.
