Counterexample to: "If a function is continuous in a point $x_0$ then it is defined in a neighborhood of that point." I'm looking for a counterexample to the statement:


  If a function is continuous in a point $x_0$ then it is defined in a
  neighborhood of that point.


If I take

$f: \mathbb{R} \setminus \mathbb{Q} \rightarrow \mathbb{R}$ defined as $f(x):=x$

Then it is continuous in any point $x_0 \in \mathbb{R}\setminus \mathbb{Q}$ since $lim_{x\to x_0} f(x)=x_0 \forall x_0 \in \mathbb{R}$, nevertheless it is not defined in any neighbourhood of any point $x_0 \in \mathbb{R}$. 

Is this counterexample correct?

Edit 

Definition of neighborhood of $x_0$: Let $x_0 \in \mathbb{R}$ and $r&gt;0$ a real number. We call a neighborhood of $x_0$ with radius $r$ the open and bounded interval in $\mathbb{R}$ $(x_0-r,x_0+r)$.

Definition of limit: Let $x_0$ be a limit point for a function $f(x)$. We write $lim_{x \to x_0} f(x)=l \iff \forall \epsilon &gt;0 \exists \delta &gt;0 \mid \forall x\in domf \wedge 0&lt;\mid x-x_0 \mid &lt;\delta \implies \mid f(x)-l\mid &lt;\epsilon$

Definition of continuity of $f$ in $x_0$: $f$ is continuous in a point $x_0$ of its domain iff $\forall \epsilon &gt;0 \exists \delta&gt;0 \mid \forall x \in dom(f) \wedge \mid x-x_0 \mid &lt; \delta \implies \mid f(x)-f(x_0)\mid &lt;\epsilon$
Assuming you are using the following definition your counterexample is correct. You could take $f(x)=0$ for all $x\in \mathbb{Q}$ for an even simpler example with a dense domain.

Let $x \in X$. If $f:X \to Y$ then we say that $f$ is continuous at $x$ if for all $\varepsilon&gt;0$ exists $\delta&gt;0$ such that

$$d_Y(f(x),f(y)) &lt; \varepsilon$$

whenever
$$y\in X, ~ d_X(x,y) &lt; \delta$$

Note that this definition is equivalent to yours when $x$ is a limit point of the domain.
No, this is not a valid counterexample because $f$ is not continuous anywhere which I will show as follows.

$$\lim_{x\to x_0}f(x)=f(x) \iff \forall \varepsilon &gt; 0, \exists \delta &gt;0: [x \in V_\delta(x_0) \implies f(x) \in V_\varepsilon(x_0)]$$

(where $V_a(b)$ is the open $a$-neighbourhood of $b$)

For any $\varepsilon,\delta&gt;0$, I can obviously pick for $x$ any rational $q \in V_\delta(x_0)$, in which case $f(x)$ will not be defined and thus cannot be an element of $V_\varepsilon(x_0)$.