I hope I'm using the terminology correctly. What I mean is this: fix $K = \mathbb{R}$ or $\mathbb{C}$ (I'm interested in both cases). Which topological spaces $X$ have the property that for every open set $U$, every continuous function $f : U \to K$ is a quotient of continuous functions $\frac{g}{h}$ where $g, h : X \to K$ and $h \neq 0$ on $U$?



Which topological spaces have the property that their sheaves of continuous functions are determined by their global sections?
This isn't a complete answer, but I think that whatever the family is, it contains compact metric (metrisable) spaces. With a paracompactness argument, I suspect that it would extend to locally compact, and I would not be surprised if one could replace "metrisable" by something weaker (though I think that it would need that separation property one-above-normal which I can never remember the name of: namely that every closed set is the zero set of a continuous function).


Here's a proof (I hope): Let $M$ be a compact metric space, $U \subseteq M$ an open subset, $f : U \to \mathbb{R}$ a continuous function. Let's write $K$ for the complement of $U$ in $M$. For each $n \in \mathbb{N}$, let $C\_n \subseteq U$ be the subset consisting of points at least distance $1/n$ away from $K$. Then $C\_n$ is closed in $M$, hence compact, and $\bigcup C\_n = U$. Let $h\_0 : M \to \mathbb{R}$ be the "distance from $K$" function (so that $C\_n = h\_0^{-1}([1/n,\infty))$). Let $V\_n$ be the complement of $C\_n$.


As $C\_n$ is compact, $f$ is bounded on $C\_n$. Let $a\_n = \max\{|f(x)| : x \in C\_n\}$, then $(a\_n)$ is an increasing sequence. Let $(b\_n)$ be a decreasing sequence that goes to $0$ faster than $(a\_n)$ increases, specifically that $(a\_nb\_n) \to 0$. Let $r : [0,\infty) \to [0,\infty)$ be a continuous decreasing function such that $r(1/n) = b\_{n+1}$ (as $(b\_n) \to 0$ (this always exists) and let $h = r \circ h\_0$. Then for $x \in V\_{n-1}$, $h\_0(x) \lt 1/(n-1)$ so $h(x) \lt b\_n$.


Then $h : M \to \mathbb{R}$ is a continuous function. Moreover, $h f$ (the product, with $h$ restricted to $U$) has the property that for $x \in C\_n \setminus C\_{n-1} = V\_{n-1} \setminus V\_n$,


$$
|(f h)(x)| = |f(x)| |h(x)| \le a\_n b\_n
$$


Thus as $x \to K$, $(f h)(x) \to 0$ and so we can extend $f h$ to a continuous function $g : M \to \mathbb{R}$ by defining it to be $0$ on $K$.


Then on $U$, $f = g/h$.


(I made this up, so obviously, there may be something I've overlooked in this so please tell me if I'm not correct.)


**Edit:** This one's been bugging me all weekend. I've even gone so far as to look up [perfectly normal](http://en.wikipedia.org/wiki/Perfectly_normal_space).


This property holds for perfectly normal spaces. In a perfectly normal space, every closed set is the zero set of a function (to $\mathbb{R}$, and this characterises perfectly normal spaces according to Wikipedia).


Here's the proof. Let $X$ be a perfectly normal space. Let $U \subseteq X$ be an open set, and $f : U \to \mathbb{R}$ a continuous function. Let $r : X \to \mathbb{R}$ be such that the zero set of $r$ is the complement of $U$. Let $s : \mathbb{R} \to \mathbb{R}$ be the function $s(t) = \min\lbrace 1, |t|^{-1}\rbrace$.


The crucial fact is that if $p : U \to \mathbb{R}$ is a **bounded** function then the *pointwise* product $r \cdot p : U \to \mathbb{R}$ (technically, $p$ should be restricted to $U$ here) extends to a continuous function on $X$ by defining it to be zero on $X \setminus U$.


From this, the rest follows easily.


1. The composition $s \circ f$ is bounded on $U$, hence $r \cdot (s \circ f)$ extends to a continuous function on $X$, say $h$.
2. The product $(s \circ f) \cdot f$ is also bounded on $U$, since $(s \circ f)(x) = \min\lbrace 1, |f(x)|\rbrace)$. Hence $r \cdot (s \circ f) \cdot f$ extends to a continuous function on $X$, say $g$.
3. As $s(t) \ne 0$ for all $t \in \mathbb{R}$, $(s \circ f)(x) \ne 0$ for all $x \in X$. Hence $h(x) \ne 0$ for all $x \in U$.
4. Finally, on $U$, $g(x) = h(x) \cdot f(x)$, whence, as $h$ is never zero on $U$, $f = g/h$ as required.


This isn't a complete characterisation of these spaces. Essentially, this result holds if there are **enough** continuous functions (as above) on $X$ and if there are too few.


As an example of the latter, consider a topological space $X$ where every pair of non-trivial open sets has non-empty intersection. Then there can be no non-constant functions to $\mathbb{R}$, either on $X$ or on any open subset thereof. Hence every continuous function on an open subset of $X$ trivially extends to the whole of $X$.


However, there's probably some argument that says that once you have sufficient continuous functions (say, if the space is functionally Hausdorff - i.e. continuous functions to $\mathbb{R}$ separate points) then it would have to be perfectly normal. The difficulty I have with making this into a proof is that there's no requirement that the function $g$ be zero on the complement.


Finally, note that metric spaces are perfectly normal so this supersedes my earlier proof. I leave it up, though, in case it's of use to anyone to see the workings as well as the current state. (Actually, for the record I ought to declare that initially I thought that this was *false* for almost all spaces. However, once I'd examined my counterexample closely, I realised my error and now I'm having difficulty thinking of a *reasonable* space where it does not hold.)


