1 Introduction

We use mostly standard terminology and notation. Let X be a topological space. For each set \(A\subset X\), the symbols \({{\,\textrm{int}\,}}A\) and \({{\,\textrm{cl}\,}}A\) denote the interior and the closure of A, respectively. The spaces \({\mathbb R}\) and \(X\times {\mathbb R}\) are considered with their standard topologies. In this paper every considered function is real. If \(f: X \rightarrow {\mathbb R},\) the symbol G(f) denotes the graph of f, i.e., \(G(f) = \{ (x, f(x)) \,:x \in X \}\). We say that a function \(f:X \rightarrow {\mathbb R}\) has a closed graph, if the graph of f is a closed subset of the product \(X\times {\mathbb R}\). We say that a function \(f:X \rightarrow {\mathbb R}\) is lower (upper) semicontinuous at a point \(x\in X\), if for each \(\varepsilon >0,\) there is a neighbourhood U of x such that \(f(z)>f(x) - \varepsilon \) (\(f(z)<f(x)+\varepsilon \), respectively) for each \(z\in U\). If \(f:X \rightarrow {\mathbb R}\) is lower (upper) semicontinuous at each point \(x\in X\), we say that f is lower (upper) semicontinuous. We say that a function \(f:X \rightarrow {\mathbb R}\) is quasi-continuous at a point \(x\in X\), if for each \(\varepsilon >0\) and for each neighbourhood U of x,  there is a nonempty open set \(V \subset U\) such that \(|f(x) - f(z)| < \varepsilon \) for each \(z \in V\). If \(f:X \rightarrow {\mathbb R}\) is quasi-continuous at each point \(x\in X\), then we say that f is quasi-continuous (see e.g. [10]). The symbols \({lsc}(X)\), \({usc}(X)\), \({{\mathcal {Q}}}(X)\), \({{\mathcal {C}}}(X)\) and \({{\mathcal {U}}}(X)\) denote the class of all real-valued functions defined on X that are lower semicontinuous, upper semicontinuous, quasi-continuous, continuous and have a closed graph, respectively.

The problem of extensions of real functions, inspired by the Tietze’s theorem, was studied in many papers, among others in [5,6,7,8] and [12]. In particular, in 2015,  Wójtowicz and Sieg proved (see [12, Theorem 3.2]) that if X is a topological Hausodorff space and A is a nonempty zero-subset of X (i.e. \(A= g^{-1} (0)\) for some continuous function \(g:X \rightarrow {\mathbb R}\)), then every function \(f_0\in {{\mathcal {U}}}(A)\) has an extension \(f\in {{\mathcal {U}}}(X)\). Moreover, in [5], some conditions under which a function defined on a topological space X can be semicontinuous were examined. This conditions refer to the behaviour of the function both on and off a dense or closed subset of X. In [7], theorems concerning the extension of semicontinuous and quasi-continuous functions were proven, in particular conditions for the existence of a lower (upper) semicontinuous (quasi-continuous) extension of a function defined on a dense subset of a Hausdorff topological space X to a lower (upper) semicontinuous (quasi-continuous) function on X were given ( [7, Theorems 2.1, 2.2, 2.4 and 2.5]).

In this paper, we study similar problems, but for (quasi-continuous) functions with a closed graph. We prove a sufficient condition for the existence of an extension of a function with a closed graph on a given dense subset of a metric space X to a function with a closed graph on X (see Theorem 2.2). Moreover, we give equivalent conditions for the existence of a (unique) extension of a quasi-continuous function with a closed graph defined on a given dense subset of a Hausdorff topological space X to a quasi-continuous function with a closed graph on X (see Theorem 2.4).

The next part of this paper was inspired by the results of [5, Proposition 3.2] for lower semicontinuous functions. In this paper, we consider similar problems for (quasi-continuous) functions with a closed graph. It is easy to see that if D is a dense subset of a topological space X, \(f:X \rightarrow {\mathbb R}\) and the restrictions \(f {\mathord {\restriction }}D \cup \{x\}\) are continuous for \(x \in X {\setminus } D\), then f is continuous (see also [3]). The analogous theorems are true for quasi-continuous functions (see Lemma 2.6) and quasi-continuous functions with a closed graph (see Proposition 2.7). Ferrer, Gregory and Alegre showed that a similar result holds for semicontinuous functions with some strong assumptions about the sets D and \(X{\setminus } D\) (see [5, Proposition 3.2 and Examples 3.3 (a) and (b)]). In this paper, we obtain an analogous result for a function with a closed graph (see Theorem 2.5 and Examples 1 and 2).

2 Main Results

We start our main section with a useful criterion for checking if the given mapping has a closed graph (e.g. [9, Theorem 14.1.1] or [11] p. 191).

Proposition 2.1

Let X and Y be topological spaces. A function \(f: X \rightarrow Y\) has a closed graph if and only if for each \(x\in X\) and for each net \((x_\gamma )\subset X\), if \(x_\gamma \rightarrow x\) and \(f(x_\gamma ) \rightarrow y,\) then \(y=f(x)\).

We will prove now a sufficient condition for extending functions with a closed graph from a dense subset of a metric space.

Theorem 2.2

Let (Xd) be a metric space and let D be dense in X. Let also \(f_0\in {{\mathcal {U}}}(D)\) be a function with a closed graph such that the following conditions hold true:

  1. (1)

    for each \(x \in X {\setminus } D\) and each sequence \((x_n), (z_n)\subset D\) such that \(x_n \rightarrow x\) and \(z_n \rightarrow x\), if \(f_0(x_n) \rightarrow y\in {\mathbb R}\) and \(f_0(z_n) \rightarrow y'\in {\mathbb R}\), then is \(y= y'\),

  2. (2)

    the set

    $$\begin{aligned} A{\mathop {=}\limits ^{df }}\{x \in X{\setminus } D:\text { if }x_n \rightarrow x\text { then }|f_0(x_n)| \rightarrow \infty \text { for each sequence }(x_n) \subset D\} \end{aligned}$$

    is an \(F_\sigma \)-subset of X.

Then there exists a function with a closed graph \(f:X \rightarrow {\mathbb R}\) such that \(f(x)=f_0(x)\) for every \(x\in D\).

Proof

For each \( x \in X {\setminus } (D \cup A)\) choose \(y_x \in {\mathbb R}\) such that there exists a sequence \((x_n)\) of elements of D with \(x_n \rightarrow x\) and \(f_0(x_n) \rightarrow y_x\).

Now, choose an increasing sequence \((F_n)\) of closed subsets of X such that \(A=\bigcup _{n \in {\mathbb N}} F_n\) (recall that A is an \(F_\sigma \)-subset of X). Put \(F_0= \emptyset \) and \(E_n = F_n {\setminus } F_{n-1}\) for each \(n \in {\mathbb N}\). Define the function \(f:X \rightarrow {\mathbb R}\) by the formula:

$$\begin{aligned} f(x)={\left\{ \begin{array}{ll} f_0(x),&{} \text {if }\,x \in D,\\ y_x,&{} \text {if }\,x\in X {\setminus } (D \cup A),\\ 0,&{} \text {if}\, x \in E_1,\\ 1/d(x,F_{n-1}),&{} \hbox {if}\, x \in E_n {,} n \in {\mathbb N}{\setminus } \{1\}. \end{array}\right. } \end{aligned}$$

Clearly, f is an extension of \(f_0\). We will show that \(f \in {{\mathcal {U}}}(X)\). Fix \(x_0\in X\). Let \((x_n)\) be a sequence of elements of X such that \(x_n \rightarrow x_0\) and \(f(x_n) \rightarrow y\in {\mathbb R}\). We will show that \(y=f(x_0)\). Let us consider the following two cases.

Case 1.  \(x_0\in A\).

Then \(x_0 \in E_k\) for some \(k \in {\mathbb N}\). First, observe that for each sequence \((x_n)\) of elements of \(X{\setminus } A\), if \(x_n \rightarrow x_0,\) then \(|f(x_n)| \rightarrow \infty \). Indeed, suppose that there is a sequence \((x_n) \subset X {\setminus } A =D\cup \bigl (X {\setminus } (D \cup A)\bigr )\) such that \(x_n \rightarrow x_0\) and \(f(x_n) \rightarrow y\) for some \(y\in {\mathbb R}\). Then, for each \(n \in {\mathbb N}\) such that \(x_n \in X {\setminus } (A \cup D)\), there is a sequence \((x^{n}_{m})\subset D\) such that \(x^{n}_{m} \rightarrow x_n\) and \(f(x^{n}_{m})=f_0(x^{n}_{m}) \rightarrow y_{x_n} = f(x_n)\). Thus, there is a sequence \((x_k)\subset D\) such that \(x_k \rightarrow x_0\) and \(f(x_k)=f_0(x_k)\rightarrow y\), a contradiction (recall that \(x_0\in A\)). So, since \(x_n \rightarrow x_0\) and \(f(x_n) \rightarrow y\), we may assume that \(x_n \in A\) for each \(n\in {\mathbb N}\) (the proof of the next part of Case 1 is similar to the part of the proof of [4, Theorem 1]). Now, notice that there is \(n_0\) such that \(x_n \in F_k\) for each \(n>n_0\). Indeed, if \(x \in \{x_n: n \in {\mathbb N}\}{\setminus } F_k\), then \(x \in E_i\) for some \(i \ge k+1\) and

$$\begin{aligned} f(x)=1/d(x,F_{i-1})\ge 1/ d(x,x_0). \end{aligned}$$

Since \(x_n \rightarrow x_0\) and \(f(x_n) \rightarrow y\), there is \(n_0\) such that \(x_n \in F_k\) for each \(n>n_0\).

In the case \(k=1\), we have \(x_0, x_n \in F_1=E_1\) and \(f(x_n)=0\) for each \(n>n_0\). Consequently, \(f(x_n) \rightarrow f(x_0)=0\) and \(y=f(x_0)\).

Now, suppose that \(k \ge 2\). Since \(x_0 \in E_k=F_k {\setminus } F_{k-1}\) and the set \(F_{k-1}\) is closed, there is \(n_1 \in {\mathbb N}\) such that \(x_n \notin F_{k-1}\) for each \(n > n_1\). Thus, \(x_n \in E_k\) for each \(n> n_0+n_1\). Consequently, since \(f {\mathord {\restriction }}E_k\) is continuous, we have \(f(x_n) \rightarrow f(x_0)\) and \(y=f(x_0)\).

Case 2.  \(x_0 \in X {\setminus } A\).

First, observe that for each sequence \((x_n)\) of elements of A, if \(x_n \rightarrow x_0,\) then \(f(x_n) \rightarrow \infty \). Indeed, suppose that there is a sequence \((x_n) \subset A \) such that \(x_n \rightarrow x_0\) and \(f(x_n) \rightarrow y\in {\mathbb R}\). Observe that if there exists \(k \in {\mathbb N}\) and \(n_0 \in {\mathbb N}\) such that \(x_n \in F_k\) for each \(n>n_0\), then (since \(x_n \rightarrow x_0\) and \(F_k\) is closed) \(x_0 \in F_k \subset A\), a contradiction. Thus, there is a subsequence \((x_{n_m})\subset (x_n)\) such that for each \(m_1,m_2 \in {\mathbb N}\), if \(m_1 \ne m_2\) there is \(k \in {\mathbb N}\) such that \(x_{n_{m_1}} \in F_k\) and \(x_{n_{m_2}} \in E_i\) for some \(i \ge k+1\), which yields

$$\begin{aligned} f(x_{n_{m_2}})=1/d(x_{n_{m_2}},F_{i-1})\ge 1/ d(x_{n_{m_2}},x_{n_{m_1}}), \end{aligned}$$

a contradiction (recall that sequences \((x_{n_m})\) and \(f(x_{n_m})\) are convergent).

So, we may assume that \(x_n \in X {\setminus } A=D\cup \bigl (X {\setminus } (A \cup D)\bigr )\) for each \(n\in {\mathbb N}\). Now, observe that for each \(n \in {\mathbb N}\) such that \(x_n \in X {\setminus } (A \cup D),\) there is a sequence \((x^{n}_{k})\) of elements of the set D such that \(x^{n}_{k} \rightarrow x_n\) and \(f(x^{n}_{k})=f_0(x^{n}_{k}) \rightarrow y_{x_n} = f(x_n)\). Thus, there is a sequence \((x_m)\) of elements of D such that \(x_m \rightarrow x_0\) and \(f(x_m)=f_0(x_m)\rightarrow y\) (recall that \(x_n \rightarrow x_0\) and \(f(x_n) \rightarrow y\), where \(y \in {\mathbb R}\) and \(x_n \in D\cup \bigl (X {\setminus } (A \cup D)\bigr )\) for each \(n\in {\mathbb N}\)).

If \(x_0\in X{\setminus }(A \cup D),\) then (by the definition of f and the assumption (1)) \(y= y_{x_0} = f(x_0)\). Moreover, if \(x_0\in D\), we clearly have \(y= f_0 (x_0)=f(x_0)\). Thus \(f \in {{\mathcal {U}}}(X)\) and the proof is complete. \(\square \)

In the next part of the paper, we will use the following characterization of functions with a closed graph (see [2, p. 118] and [1]).

Proposition 2.3

Let X be a topological space. A function \(f:X \rightarrow {\mathbb R}\) has a closed graph if and only if for each \(x\in X\) and for each \(m \in {\mathbb N}\) there is a neighbourhood V of x such that \(f(V)\subset (-\infty , -m) \cup (f(x)-1/m, f(x)+ 1/m) \cup (m, \infty )\).

Our next result is a characterization of extending a quasi-continuous function with a closed graph defined on a dense subset of a Hausdorff space X.

Theorem 2.4

Let X be a Hausdorff topological space and let D be dense in X. Let also \(f_0:D \rightarrow {\mathbb R}\) be a quasi-continuous function with a closed graph. Then the following three conditions are equivalent:

  1. 1.

    there is a unique extension of \(f_0\) to a quasi-continuous function with a closed graph \(f:X \rightarrow {\mathbb R}\),

  2. 2.

    there exists an extension of \(f_0\) to a quasi-continuous function with a closed graph \(g:X \rightarrow {\mathbb R}\),

  3. 3.
    1. (i)

      for each \(x \in X {\setminus } D\) there exists a net \((x_\gamma )\subset D\) such that \(x_\gamma \rightarrow x\) and \(f_0(x_\gamma ) \rightarrow y\in {\mathbb R}\),

    2. (ii)

      for each \(x \in X {\setminus } D\) and for each nets \((x_\gamma ), (z_{\gamma })\subset D\) such that \(x_\gamma \rightarrow x\), \(z_{\gamma } \rightarrow x\) and \(f_0(x_\gamma ) \rightarrow y\in {\mathbb R}\), \(f_0(z_{\gamma }) \rightarrow y'\in {\mathbb R}\), then is \(y= y'\).

Proof

The implication (1) \(\Rightarrow \) (2) is obvious.

(2) \(\Rightarrow \) (3). Since \(g:X \rightarrow {\mathbb R}\) is a quasi-continuous extension of \(f_0\) and the set D is dense in X, the first requirement of the condition (3) is fulfilled (see [7, Theorem 2.3]. Moreover, since the function g has a closed graph and g is a extension of \(f_0\), the second requirement of (3) is obvious.

(3) \(\Rightarrow \) (1). Assume that the (3) is true. For each \( x \in X {\setminus } D\) choose \(y_x \in {\mathbb R}\) such that there exists a net \((x_\gamma )\subset D\) with \(x_\gamma \rightarrow x\) and \(f_0(x_\gamma ) \rightarrow y_x\).

Let \(f:X \rightarrow {\mathbb R}\) be a mapping given by the formula:

$$\begin{aligned} f(x)={\left\{ \begin{array}{ll} f_0(x),&{} \text {if}\, x \in D,\\ y_x,&{} \text {if}\, x\in X {\setminus } D. \end{array}\right. } \end{aligned}$$

Clearly, f is an extension of \(f_0\). Moreover, from the proof of [7, Theorem 2.3], it follows that \(f \in {{\mathcal {Q}}}(X)\). We must show that \(f \in {{\mathcal {U}}}(X)\). Let \(x_0\in X\) and \(m \in {\mathbb N}\). We will prove that there is a neighbourhood U of \(x_0\) such that

$$\begin{aligned} {f(U)\subset (-\infty , -m) \cup (f(x_0)-1/m, f(x_0)+ 1/m) \cup (m, \infty ).} \end{aligned}$$

First, we will show that there is a neighbourhood U of \(x_0\) such that \(f(x) \in (-\infty , -1/(2m))\cup (f(x_0) - 1/(2m), f(x_0) + 1/({2\,m}) \cup (2\,m, \infty )\) for each \(x \in U \cap D\). We consider two cases.

If \(x_0 \in D\), then since the function \(f {\mathord {\restriction }}D\) has a closed graph the above condition holds.

Now, let \(x_0 \in X {\setminus } D\). From the first part of the condition (3) and the definition of the function f, it follows that there is a net \((x_\gamma )\) of elements of D such that \(x_\gamma \rightarrow x_0\) and \(f_0(x_\gamma )= f(x_\gamma )\rightarrow y_{x_0}=f(x_0)\). Suppose, by way of contradiction, that for each neighbourhood U of \(x_0\) there is \(x_U \in U \cap D\) such that \(f(x_U) \in [-2\,m, 2\,m]\) and \(f(x_U) \notin (f(x_0)-1/(2m), f(x_0)+ 1/(2m))\). Consequently, there is a net \((x_\alpha )\) of elements of D such that \(x_\alpha \rightarrow x_0\) and \(f(x_\alpha )=f_0(x_\alpha )\rightarrow y\), where \(y \in [-2m, 2m] {\setminus } (f(x_0)-1/(2m), f(x_0)+ 1/(2m))\). Clearly, \(y \ne y_{x_0}=f(x_0)\), a contradiction with the second part of the condition (3). Therefore, there is a neighbourhood U of \(x_0\) such that \(f(x) \in (-\infty , -2\,m)\cup (f(x_0) - 1/(2m), f(x_0) + 1/(2m)) \cup (2\,m, \infty )\) for each \(x \in U \cap D\).

Now, suppose that \(f(z) \notin (-\infty , -m)\cup (f(x_0) - 1/m, f(x_0) + 1/m) \cup (m, \infty )\) for some \(z \in U {\setminus } D\). Since f is quasi-continuous at z and the set D is dense in X, there is a nonempty open set \(V\subset U\) and a point \(d \in V \cap D \subset U \cap D\) such that \(|f(d)-f(z)| < 1/(2m)\). Observe now that \(|f(d)| \le |f(d)-f(z)|+|f(z)|< 1/({2m})+m< 2m\) and \(|f(d)-f(x_0)|\ge |f(z)-f(x_0)|- |f(z)-f(d)|> 1/m - 1/({2m})=1/(2m)\). Consequently, \(f(d) \notin (-\infty , -2\,m) \cup (f(x_0) - 1/(2m), f(x_0) + 1/(2m))\cup (2\,m, \infty )\), a contradiction.

The last thing is to show that the function f is unique. Let \(g:X \rightarrow {\mathbb R}\) be an extension of \(f_0:D \rightarrow {\mathbb R}\) such that \(g \ne f\). Then there is a point \(x_0 \in X{\setminus } D\) such that \(g(x_0) \ne f(x_0) =y_{x_0}\). Since \((x_0, f(x_0)) \in {{\,\textrm{cl}\,}}G(g){\setminus } G(g)\), \(g \notin {{\mathcal {U}}}(X)\). Thus, f is a unique quasi-continuous extension with a closed graph of \(f_0\). That completes the proof. \(\square \)

The last part of the paper was inspired by the results of [5, Proposition 3.2] for lower semicontinuous functions. We prove an analogous result for functions with a closed graph (the proof of Theorem 2.5 repeats the proof of [5, Proposition 3.2]).

Theorem 2.5

Let X be a topological space and let \(f:X \rightarrow {\mathbb R}\). Assume that D is a dense subset of X such that \(X {\setminus } D\) is discrete in X, and for each \(d \in D\) there is a neighbourhood of d whose intersection with \(X {\setminus } D\) is finite. Then f has a closed graph if and only if the restriction \(f {\mathord {\restriction }}D \cup \{x\}\) is a function with a closed graph for each \(x \in X {\setminus } D\).

Proof

Suppose that \(f {\mathord {\restriction }}D \cup \{x\}\) is a function with a closed graph for each \(x \in X {\setminus } D\). Let \(x_0\in X\) and \(m \in {\mathbb N}\). We will show that there is a neighbourhood V of \(x_0\) such that

$$\begin{aligned} {f(V)\subset (-\infty , -m) \cup (f(x_0)-1/m, f(x_0)+ 1/m) \cup (m, \infty ).} \end{aligned}$$
(2.1)

We consider two cases. Assume first that \(x_0 \in X {\setminus } D\). Since \(x_0\) is an isolated point in \(X {\setminus } D\), there is an open set U such that \(U \cap (X {\setminus } D) = \{x_0\}\). Moreover, since \(f {\mathord {\restriction }}D \cup \{x_0\}\) is a function with a closed graph, there is a neighbourhood \(V\subset U\) of \(x_0\), such that condition (2.1) holds.

On the other hand, let \(x_0 \in D\). If \(x_0 \in {{\,\textrm{int}\,}}D\), then (since \(f {\mathord {\restriction }}D\) has a a closed graph) there is a neighbourhood V of \(x_0\) such that condition (1) holds. If \(x_0 \in D{\setminus }{{\,\textrm{int}\,}}D\), there is a neighbourhood U of \(x_0\) such that \(U \cap (X {\setminus } D)=\{c_1,\ldots , c_n\}\). Since \(f {\mathord {\restriction }}D \cup \{c_i\}\) is a function with a closed graph for each \(i \in \{1,\ldots ,n \}\), there is a neighbourhood \(V_i\) of \(x_0\) such that \(f(z)\in (-\infty , -m) \cup (f(x_0)-1/m, f(x_0)+ 1/m) \cup (m, \infty )\) for each \(z \in V_i\cap (D \cup \{c_i\})\) and each \(i \in \{1,\ldots ,n \}\). Then \(V {\mathop {=}\limits ^{df }}U \cap V_1 \cap \ldots \cap V_n\) is a neighbourhood of \(x_0\) which satisfies the condition (2.1). \(\square \)

The following two examples show that the assumptions about sets D and \(X{\setminus } D\) in Theorem 2.5 are necessary

Example 1

Let \(({\mathbb R},d)\) be a metric space, where d denotes the natural metric and let \(f:{\mathbb R}\rightarrow {\mathbb R}\) be a function given by the formula

$$\begin{aligned} f(x)={\left\{ \begin{array}{ll} 1,&{} \text {if}\, x\le 0,\\ 1/\left( d(x,\left\{ \frac{1}{n+1}, \frac{1}{n}\right\} )\right) ,&{} \hbox {if}\, x \in \left( \frac{1}{n+1}, \frac{1}{n}\right) , \; n \in {\mathbb N},\\ 0,&{} \text {if }\,x \in \left\{ \frac{1}{n}: n \in {\mathbb N}\right\} \cup (1, \infty ), \end{array}\right. } \end{aligned}$$

and let \(D {\mathop {=}\limits ^{df }}{\mathbb R}{\setminus } \{1/n \,:n \in {\mathbb N}\}\).

Clearly, the set D is dense in \({\mathbb R}\). It is easy to see that the function \(f {\mathord {\restriction }}D \cup \{1/n\}\) has a closed graph for each \(n \in {\mathbb N}\) and the set \({\mathbb R}{\setminus } D= \{1/n \,:n \in {\mathbb N}\}\) is discrete in \({\mathbb R}\). However, each neighbourhood of \(0 \in D\) has infinitely many points of \({\mathbb R}{\setminus } D\) and \(f\notin {{\mathcal {U}}}(X)\) (since \((0,0) \in {{\,\textrm{cl}\,}}G(f) {\setminus } G(f)\)).

Example 2

Consider the function \(f: {\mathbb R}\rightarrow {\mathbb R}\) defined in Example 1. Let

$$\begin{aligned} D {\mathop {=}\limits ^{df }}{\mathbb R}{\setminus } (\{1/n \,:n \in {\mathbb N}\}\cup \{0\}). \end{aligned}$$

It is easy to see that the restriction \(f {\mathord {\restriction }}D \cup \{x\}\) is a function with a closed graph for each \(x \in {\mathbb R}{\setminus } D\). However, for each \(d \in D,\) there is a neighbourhood V of d such that \(V \cap ({\mathbb R}{\setminus } D) = \emptyset \) (because D is open), but 0 is not an isolated point in \({\mathbb R}{\setminus } D\) and \(f\notin {{\mathcal {U}}}(X)\).

To complete the paper, we will show that if in the above Theorem 2.5 we replace the assumptions about the sets D and \(X {\setminus } D\) by quasi-continuity of f on \(X{\setminus } D\), then again \(f:X \rightarrow {\mathbb R}\) has a closed graph (and is also quasi-continuous). First, we will prove the following lemma for quasi-continuous functions, which we will use in the proof of the next proposition.

Lemma 2.6

Let X be a topological space and let D be dense in X. The mapping \(f:X\rightarrow {\mathbb R}\) is quasi-continuous if and only if \(f {\mathord {\restriction }}D \cup \{x\}\) is a quasi-continuous function for each \(x \in X {\setminus } D\).

Proof

Let D be dense in X. Assume that \(f {\mathord {\restriction }}D \cup \{x\}\) is a quasi-continuous function for each \(x \in X {\setminus } D\). We will prove that \(f \in {{\mathcal {Q}}}(X)\).

Fix \(x_0 \in X\) and \(\varepsilon > 0\). Let U be a neighbourhood of \(x_0\). Since the restriction \(f {\mathord {\restriction }}D \cup \{x_0\}\) is quasi-continuous, there is a nonempty open set \(V \subset U\) such that \(|f(x) - f(x_0)| < \varepsilon /2\) for each \(x \in V \cap (D \cup \{x_0\})\). We will show that \(|f(x) - f(x_0)| < \varepsilon \) for each \(x \in V {\setminus } (D \cup \{x_0\}) \).

Suppose that \(|f(z) - f(x_0)| \ge \varepsilon \) for some \(z \in V {\setminus } (D \cup \{x_0\})\). Since the restriction \(f {\mathord {\restriction }}D \cup \{z\}\) is quasi-continuous, there is a nonempty open set \(G \subset V\) such that \(|f(x) - f(z)| < \varepsilon /2\) for each \(x \in G \cap (D \cup \{z\})\). Thus, since D is dense in X, there exists a point \(d \in G \cap D \subset V \cap D\) such that \(|f(d) - f(z)| < \varepsilon /2\). Hence \(|f(d) - f(x_0)| \ge |f(z) - f(x_0)| - |f(z) - f(d)| \ge \varepsilon /2\), a contradiction.

Thus \(|f(x) - f(x_0)| < \varepsilon \) for each \(x \in V\) and \(f \in {{\mathcal {Q}}}(X)\). \(\square \)

Proposition 2.7

Let X be a topological space and let D be a dense subset of X. Then \(f:X \rightarrow {\mathbb R}\) is a quasi-continuous function with a closed graph if and only if \(f {\mathord {\restriction }}D \cup \{x\}\) is a quasi-continuous function with a closed graph for each \(x \in X {\setminus } D\).

Proof

Let D be dense in X. Assume that \(f {\mathord {\restriction }}D \cup \{x\}\) is a quasi-continuous function with a closed graph for each \(x \in X {\setminus } D\). From Lemma 2.6, we obtain that \(f \in {{\mathcal {Q}}}(X)\). It is enough to prove that \(f \in {{\mathcal {U}}}(X)\).

Fix \(x_0 \in X\) and let \(m \in {\mathbb N}\). We will show that there is a neighbourhood U of \(x_0\) such that \(f(U)\subset (-\infty , -m) \cup (f(x_0)-1/m, f(x_0)+ 1/m) \cup (m, \infty )\).

Since the restriction \(f {\mathord {\restriction }}D \cup \{x_0\}\) has a closed graph, there is a neighbourhood U of \(x_0\) such that \(f(x) \in (f(x_0) - 1/(2m), f(x_0) + 1/(2m)) \cup (-\infty , -2\,m)\cup (2\,m, \infty )\) for each \(x \in U \cap (D \cup \{x_0\})\). Suppose that \(f(z) \notin (f(x_0) - 1/m, f(x_0) + 1/m) \cup (-\infty , -m)\cup (m, \infty )\) for some \(z \in U {\setminus } (D \cup \{x_0\})\). Since \(f {\mathord {\restriction }}D \cup \{z\}\) is quasi-continuous at z and the set D is dense in X, there is a nonempty open set \(V\subset U\) and a point \(d \in V \cap D \subset U \cap D\), such that \(|f(d)-f(z)| < 1/(2m)\). Observe that \(|f(d)| \le |f(d)-f(z)|+|f(z)|< 1/(2m)+m< 2m\) and \(|f(d)-f(x_0)|\ge |f(z)-f(x_0)|- |f(z)-f(d)|> 1/m - 1/(2m)=1/(2m)\). Consequently \(f(d) \notin (f(x_0) - 1/(2m), f(x_0) + 1/(2m))\cup (-\infty , -2\,m)\cup (2\,m, \infty )\), a contradiction. That completes the proof. \(\square \)

An open problem related to the above considerations reads as follows.

Problem 2.8

Give an equivalent condition for existence of an extension of a function \(f_0\) with a closed graph defined on a given dense subset of a metric or a topological space X, to a function \(f:X\rightarrow {\mathbb R}\) with a closed graph.