[proofplan]
We prove continuity by using the open-set definition: a map between topological spaces is continuous exactly when the preimage of every open set in the codomain is open in the domain. Since the topology on $X$ is discrete, every subset of $X$ is open. Therefore each preimage $f^{-1}(V)\subseteq X$ of an open set $V\subseteq Y$ automatically belongs to the topology on $X$.
[/proofplan]
[step:Declare the topology on the domain as the full power set]
Let $\tau_X$ denote the topology on $X$. Since $X$ has the [discrete topology](/page/Discrete%20Topology), by definition
\begin{align*}
\tau_X = \mathcal{P}(X),
\end{align*}
where $\mathcal{P}(X)$ denotes the power set of $X$. Hence every subset $A\subseteq X$ is an open set in $(X,\tau_X)$.
[/step]
[step:Show that preimages of open sets in $Y$ are open in $X$]
Let $V\in \tau_Y$ be an arbitrary open set of the topological space $(Y,\tau_Y)$. Define the preimage subset
\begin{align*}
f^{-1}(V) := \{x\in X : f(x)\in V\}.
\end{align*}
This is a subset of $X$, so $f^{-1}(V)\in \mathcal{P}(X)=\tau_X$. Thus $f^{-1}(V)$ is open in $(X,\tau_X)$.
[guided]
We want to prove that the map
\begin{align*}
f: (X,\tau_X) &\to (Y,\tau_Y)
\end{align*}
is continuous. By the open-set definition of [continuity](/page/Continuity), it is enough to prove the following statement: for every open set $V\in \tau_Y$, the preimage $f^{-1}(V)$ belongs to $\tau_X$.
So let $V\in \tau_Y$ be arbitrary. The preimage of $V$ under $f$ is the subset of $X$ defined by
\begin{align*}
f^{-1}(V) := \{x\in X : f(x)\in V\}.
\end{align*}
The important point is that this set is a subset of the domain $X$. Since $X$ carries the discrete topology, its topology is
\begin{align*}
\tau_X = \mathcal{P}(X).
\end{align*}
Thus every subset of $X$ is open in $(X,\tau_X)$. Applying this to the particular subset $f^{-1}(V)\subseteq X$, we get
\begin{align*}
f^{-1}(V)\in \tau_X.
\end{align*}
Since $V\in \tau_Y$ was arbitrary, the preimage of every open set in $Y$ is open in $X$.
[/guided]
[/step]
[step:Conclude continuity from the open-set criterion]
The preceding step proves that for every $V\in \tau_Y$, the preimage $f^{-1}(V)$ belongs to $\tau_X$. By the open-set criterion for [continuity](/page/Continuity), the map
\begin{align*}
f: (X,\tau_X) &\to (Y,\tau_Y)
\end{align*}
is continuous. This proves the theorem.
[/step]