$f$ brings convergent nets to convergent nets, is it continuous?

Let $f:(X,\mathcal T)\to (Y,\mathcal S)$ be a function between topological spaces. Let for any convergent net $(x_\alpha)$ in $X$, $(f(x_\alpha ))$ be convergent in $Y$. Is $f$ continuous?

(It seems to be true in completely regular spaces).

Solutions Collecting From Web of "$f$ brings convergent nets to convergent nets, is it continuous?"

I think for first-countable domains, and more generally, Fréchet-Urysohn spaces, where continuity can be characterized by sequences, a function must be continuous if the codomain is Hausdorff. For assume the function is not continuous at a point $x\in X$. Then there is a sequence $(a_n)_n\to x$ whose image $(f(a_n))_n$ converges to a point $y\neq f(x)$. Clearly the constant sequence at $x$ has constant image $f(x)$. We can combine these sequences to a sequence $(b_n)_n$ by letting $b_{2n}=x$ and $b_{2n-1}=a_n$, and this sequence converges to $x$. By hypothesis the image $f(b_n)_n$ converges, hence by Hausdorff the cluster points $y$ and $f(x)$ must be equal, a contradiction.

One can generalize this to nets: Let $f:X\to Y$ be a map into a Hausdorff space. Assume that $\Phi$ is a net in $X$ over the directed set $(A_1,\le_1)$ converging to $x\in X$. Let $(A_2,\le_2)$ be a copy of $A_1$ and $\Phi^x$ be the constant net $x$ over $A_2$. Let $(A,\le)$ be the disjoint union of $A_1$ and $A_2$ and define $a\le b\iff a\le_1 b$ (both $a,b$ can be seen as elements in $A_1$). This is still a directed set, so let $\Psi$ be the union of the nets, which still converges to $x$. Its image $f(\Psi)$ is convergent by hypothesis and has cluster point $f(x)$, so it converges to $f(x)$. Since $\Phi$ is an (M-)subnet of $\Psi$, it also converges to $f(x)$. We conclude that $f$ is continuous.

Interestingly, the same reasoning shows that $f$ is continuous if $Y$ is a uniform space, not necessarily Hausdorff, and $f$ bring convergent nets to Cauchy nets.

Note that the result holds if we replace nets by filters:
If $\mathcal F$ is a convergent filter, then Net$(\mathcal F)$ converges and by hypothesis has a convergent/Cauchy image $f(\text{Net}(\mathcal F))$, and then Filter$(f(\text{Net}(\mathcal F)))=f(\mathcal F)$ converges/ is Cauchy.
Conversely, assume that the image of each convergent filter converges/ is Cauchy. Let $\Phi:I\to X$ be a convergent net. Then Filter$(\Phi)$ converges, thus $f(\text{Filter}(\Phi))=\text{Filter}(f(\Phi))$ converges/ is Cauchy which implies that $f(\Phi)$ converges/ is Cauchy.

For an example, where your conditions are satisfied, let $Y=\{0,1,2\}$ with the topology generated by $\{0\}$ and $\{2\}$. Let $f:I\to Y,\ \ f(x)=\cases{
1&\text{, if }x<1\\
0&\text{, if }x=1
}$, where $I$ is the unit interval $[0,1]$ with the euclidean topology. This function is not continuous. However, the image of each convergent net converges to $1$ as does every net in $Y$.

The “correct” characterization of continuity of functions using nets is:

Proposition: Let $X$ and $Y$ be topological spaces. For a map $f: X \rightarrow Y$, the following are equivalent:
(i) For every convergent net ${\bf x} \rightarrow x$ in $X$, $f({\bf x}) \rightarrow f(x)$ in $Y$.
(ii) $f$ is continuous.

This is Proposition 3.2 in these notes. The proof is left as an exercise. Here is how to prove (i) $\implies$ (ii): combine Proposition 3.1 — The closure of a subset $S$ in a topological space is the set of limits of convergent nets with values in $S$ — with Theorem 3 from these notes: a function $f: X \rightarrow Y$ is continuous iff for every subset $S$ of $X$, $f(\overline{S}) \subset \overline{f(S)}$. (The proof of (ii) $\implies$ (i) is the same easy proof as for sequences.)

The OP’s question is subtly different from this, since he says only that $f(\bf{x})$ is convergent, not that it converges to $f(x)$. The very next result in my notes on convergence is Proposition 3.3: a space $X$ is Hausdorff iff every net in $X$ converges to at most one point.

So the answer to the OP’s question is yes when $Y$ is Hausdorff. (Added: to see this one implements a net-theoretic analogue of the construction in Stefan H.’s answer. Let me know if more details on this are desired.)

One should be skeptical of the statement otherwise, and indeed Stefan H. has given a nice counterexample in his answer: presumably one of the simplest possible ones. Note that a feature of his construction is to take a space $Y$ in which there is a point $y$ which admits no proper open neighborhood. Any net in such a space must converge to $y$!