Determining continuity between subsets of topological space Suppose X is a topological space, say built on the set of all integers.  It seems to me the notion of topological continuity (and continuous function) is defined between two topological spaces.  I am interested in the topological continuity between subsets of given, same topology (in this case X).  Of course, there exists continuous function between two open sets of the X, but suppose A is a proper subset of X such that we do not know if A is open or closed...
I want to know if there exists a continuous function from that subset A to an open set U, which then shows A is indeed an open set of the X as long as continuous function from A to U is surjective (the inverse image of U is entire A).  If such onto continuous function exists from A to U, how do we know if A is an open set with respect to topology X, or A as a subspace topology of X (meaning the inverse image of U, which is entire A, is open by A considered as a subspace topology).  I want to believe that such function shows A is an open set with respect to topology X, and not as a subspace topology, but could we make such claim for sure?
Summary, I am interested in verifying whether a subset of topological space is open or not by showing the existence of surjective continuous function that set to another open set.
 A: If $A \subseteq X$ and $U \subseteq X$ open, having a surjective continuous map $A \longrightarrow U$ is not enough to conclude that $A$ is open in $X$. Here's a counterexample. Take $X = \{a, b\}$ with the topology $\{\emptyset, \{a\}, \{a, b\}\}$. Then let $U = \{a\}$ and $A = \{b\}$. The topologies on $U, A$ are necessarily discrete so the map $A \longrightarrow U$ via $b \mapsto a$ (the only possible map here) is continuous. In fact, it's a homeomorphism. However, $A$ is still not open in $X$. In fact, this map actually extends to all of $X$ via the constant map $f(x)= a$. This is a continuous surjection with $f[A] = U$ but $A$ is still not open in $X$. You are, however, completely right to say that it is open in $A$ itself under the subspace topology.
A: It can fail badly. Let
$$A=(-1,0)\cup\bigcup_{n\in\Bbb Z^+}\left(\frac1{2n+1},\frac1{2n}\right)\;;$$
clearly $A$ is open in $\Bbb R$ and has cardinality $2^\omega=\mathfrak{c}$. Let
$$U=\{0\}\cup\left\{\frac1n:n\in\Bbb Z^+\right\}\;;$$
$U$ is not open in $\Bbb R$, and it is countable, so $|U|<|A|$.
Let
$$f:A\to U:x\mapsto\begin{cases}
0,&\text{if }x\in(-1,0)\\
\frac1n,&\text{if }x\in\left(\frac1{2n+1},\frac1{2n}\right)\;;
\end{cases}$$
then $f$ is surjective and continuous.
