# Continuous Mapping from arbitrary space to discrete space

So I'm asked to name all continuous mapping from an arbitrary space Y to discrete space X. Using the definition of continuity from point-set topology, the mapping is continuous if for every open set U in Y, the preimage of U in X is open as well.

Proof: Remember that the singleton sets are open in the discrete space X. Consider an open set U in Y. Hence,if the preimage of U is a union of singleton sets in X then the mapping is continuous. This is the constant mapping of Y into X.

I'm unsure if these are the only continuous mapping from these two spaces. Any help is appreciated.

If $X$ is discrete, then $f:Y\to X$ is continuous if and only if $f^{-1}(\{x\})$ is open in $Y$ for each $x\in X$. In particular, if $f(y)=x$, then $y\in f^{-1}(\{x\})$ and $f^{-1}(\{x\})$ is open; therefore, $y$ has a neighborhood $f^{-1}(\{x\})$ on which $f$ is constant. This condition holds for every $y\in Y$. In general, if every $y\in Y$ has a neighborhood on which $f$ is constant, then we say that $f$ is locally constant. Conversely, if $f$ is a locally constant function from a topological space to a discrete space, then $f$ is continuous; this follows directly from the property of being locally constant combined with the definition of continuity. (Use the fact that the singleton sets of $X$ form a basis for the topology on $X$.)
It is not true in general that $f$ must be the ("globally") constant map. For example, if $Y$ has two open connected components, then $Y$ can map one connected component to one element of $X$ and the other connected component to another element of $X$, while still being continuous.
You are confused about the direction of your mapping. You say "Consider an open set $U$ in $Y$. Hence if the preimage of $U$...". That makes no sense - for mappings from $Y$ to $X$, the preimage is a subset of $Y$ and the image is a subset of $X$, so if $U$ is already a subset of $Y$, it doesn't have a preimage.
For mappings from an arbitrary space Y to a discrete space X, i.e. functions $$f\,:\, Y \to X$$ every preimage $U \subset Y$ of some set $V \subset X$ must be open, since every $V \subset X$ is open if X is a discrete space. That's certainly true for the constant mapping $f(x) = c$, because $Y$ itself is open. Whether it's true for other mappings depends on the topology of $Y$ - for example if $Y$ is discrete too, every $f$ is continuous. If $Y$ is the disjoint union of two open sets $Y_1$ and $Y_2$, then any mapping that takes $Y_1$ to $c_1$ and $Y_2$ to $c_2$ is continuous. Without more information about the topology of $Y$, you cannot describe all the continuous $f$ (well, other than saying all sets $f^{-1}(c)$ must be open in $Y$).
If you're looking at mappings from a discrete space $X$ to an arbitrary space $Y$, i.e. at functions $$f\,:\, X \to Y$$ then every preimage $U \subset X$ is always open, because every set is open in the topology of $X$. Thus, every function is continuous then.