Topology such that function is continuous if and only if the restriction is.

Let $X$ be a topological space and $A \subset X$. If $f : X \to Y$ is continuous, then $f|_A$ is automatically continuous (where $A$ has been equipped with the subspace topology). What about the converse? That is, for a fixed $A \subset X$, is there a topology on $X$ such that $f : X \to Y$ is continuous whenever $f|_A : A \to Y$ is?

• Yes. You can equip $X$ with the discrete topology, but this is not very enlightening since every map from the discrete topology is continuous. – Daniel Montealegre Sep 18 '13 at 4:59
• Of course. I should have asked for the coarsest such topology. – user95483 Sep 18 '13 at 5:04

Any function $f : X \to Y$ with $X$ discrete is continuous.

For general $X$ and $Y$, for the converse to hold, you need $A$ to be an open subset of $X$. To see why, let $f = 1_A : X \to \{0,1\}$ be the indicator function $$1_A(x) = \begin{cases} 1 & \text{if}\ x \in A \\ 0 & \text{otherwise} \end{cases}$$ and endow $\{0,1\}$ with the discrete topology. Then $f|_A$ is constant, hence continuous, and so $A = f^{-1}(\{1\})$ is open in $X$.

• Ok, $f|_A$ is constant, so it is continuous as $\{0, 1\}$ has the discrete topology. So $A$ must be open in $X$. This is necessary, but is it sufficient? – user95483 Sep 18 '13 at 5:03
• Absolutely not! For instance, the indicator function of $(0,1)$ as a subset of $\mathbb{R}$ is not continuous. In general, if your topology on $X$ is fixed, then there isn't much more you can say. – Clive Newstead Sep 18 '13 at 5:06
• ...as a really silly example, take $A = \varnothing$. Any function whatsoever is continuous when restricted to $\varnothing$ (it's the empty function), and so you can't say anything at all about the function you're restricting! – Clive Newstead Sep 18 '13 at 5:07
• @user95483: Suppose that $A\subsetneqq X$, and let $x\in X\setminus A$. Let $f$ be the indicator function of $\{x\}$; then $f\upharpoonright A$ is continuous, but $f$ is continuous iff $x$ is isolated. Thus, you need $A$ to be open and $X\setminus A$ to be discrete. – Brian M. Scott Sep 18 '13 at 5:09
• @user95483: I can’t speak for Clive, but I don’t think that I’ve ever seen it. I think that it’s more a matter of experience: if you realize that continuity on $A$ really doesn’t tell you anything about how the function behaves on the rest of $X$, it’s not hard to guess that you’ll need a topology on $X\setminus A$ that lets just about any function be continuous on $X\setminus A$, and that means that $X\setminus A$ probably has to be discrete. At that point it’s just a matter of finding a way to prove the insight. – Brian M. Scott Sep 18 '13 at 5:18

What you are searching for is the so-called final topology. Imagine you have a set $X,$ a space $A$ and a map $i:A\to X.$ Then you can equip $X$ with a topology such that every function $g:X\to Y$ into a space $Y$ is continuous if and only if $g\circ i:A\to Y$ is continuous. It is easy to prove that a topology with this property is unique. We can also show that it exists, namely the open sets in $X$ are defined to be the sets $U$ such that $i^{-1}(U)$ is open in $A.$

In the case that $A$ is a subspace of $X$ and $i:A\hookrightarrow X$ is the embedding, then the restriction $f|_A$ can be expressed as the composition $f\circ i.$ Then the final topology will have as open sets all sets $U$ of $X$ such that $i^{-1}(U)=U\cap A$ is open in $A.$