Can continuity be characterized by nets? Let $X$ and $Y$ be topological spaces  (not necessarily assumed to be  Hausdorff or to have any additional property) and let $f:X\to Y$ be a given function.  Is it true that $f$ is continuous iff
for every $x\in  X$, and every net $\{x_i\}_i$ converging to $x$, one has that
$f(x_i)\to f(x)$.

PS: I have searched for this specific question in MSE and, although I found several posts discussing it (this,
this, and this) with varying degress of objectivity, and using various additional hypothesis (Hausdorff,
completely regular, first countable) I do not believe it can be found in the exact terms above.
I therefore thought it would be nice to register it here.
I am also providing an answer which I hope  is similar to the one in The Book $\ddot \smile$
 A: The proof of the "only if" part is well known, so let us prove the "if" part.
Assuming by contradiction that $f$ is discontinuous at a point $x$ in $X$, we will build a net $\{x_i\}_{i\in I}$ converging
to $x$, such that $\{f(x_i)\}_{i\in I}$ does not converge  to $f(x)$.  The set of indices for our net will be the set $N_x$
formed by  all neighborhoods of
$x$, and viewed as a directed set with order given by reverse inclusion,  namely,
$$
  U\geq V \Leftrightarrow   U\subseteq  V.
  $$
Since $f$ is discontinuous at $x$, there exists a neighborhood $U$ of $f(x)$ such that $f(V)\not\subseteq U$, for all
$V\in N_x$. Therefore,   for any such $V$ we may  choose some $x_V\in V$ such that $f(x_V)\not\in U$.
It is then evident that the net $\{x_V\}_{V\in  N_x}$ converges to $x$, while $\{f(x_V)\}_{V\in  N_x}$ does not converge to $f(x)$.

PS:  The same argument above shows that $f$ is continuous at a given point $x_0$,
if and only  if,  for every net $\{x_i\}_{i\in I}$,  converging to $x_0$,  one has that
$\{f(x_i)\}_{i\in I}$ converges to $f(x_0)$.
