In Kelley's general topology book, in chapter 3 excercise D Continuity at a point; continuous extension says:
Let $f$ definied on a subset $X_0$ of a topological space $X$ with values in a Hausdorff space $Y$; then $f$ is continuous at $x$ iff $x$ belongs to the closure of $X_0$ and for some member $y$ of the range the inverse of each neighborhood of $y$ is the instersection of $X_0$ and a neighborhood of $x$
Clause A) states:
A function $f$ is continuous at $x$ iff $x\in \bar{X_0}$ and whenever $S$ and $T$ are nets in $X_0$ converging to $x$ then $f\circ S$ and $f\circ T$ converge to the same point of $Y$
Proving that a function which is continuous at $x$ implies clause A) was almost obvious, but I couldn't proof that if $f \circ S$ and $f \circ T$ are nets converging to the same point of $Y$ implies the existence of such $y$ point that inverse of each neighborhood is the instersection of $X_0$ and a neighborhood of $x$. How can I proof it?
For instance, let be $X$ is the usual topology for the real numbers, $X_0$ the interval $(0,2)$, $f$ the indentity function defined in $(0,2)$, $Y=X$ (both are Hausdorff spaces); then $\bar{X_0}=[0,2]$. Each net $S$ in $(0,2)$ converging to $2$ converges to the same point of $Y$, which is $2$. But there isn't a point $y$ in $(0,2)$ (range of $f$) which the inverse of each neighborhood of $y$ is the instersection of $(0,2)$ and a neighborhood of $2$
As $X=X_0$ in your example, there is no problem. There is no net in $X_0$ converging to $2$ (in $X$, which is what is meant), because $2 \notin X$. This statement is only of interest if $x \in X\setminus X_0$, really, because then we're extending $f$ to a larger subset $X_0 \cup \{x_0\}$, that $f$ was not previously defined on.
To paraphrase Kelly: $f: X_0 \to Y$ is continuous and $X_0 \subseteq X$. Then $f$ is continuous at $x \in X$ iff $x \in \overline{X_0}$ and $\exists y \in Y$ such that if $N_y$ is a neighbourhood of $y$ in $Y$, there is a neighbourhood $N_x$ of $x$ such that $f^{-1}[N_y]=N_x \cap X_0$.
The nets-condition A is then: for all nets $S$ and $T$ in $X_0$ that converge to $x_0$ in $X$ we have that $f \circ S$ and $f \circ T$ converge to the same point.