If $(X, \mathcal{D})$ is a discrete space and $(Y, \mathcal{T})$ is any topological space than any $f:X \rightarrow Y$ is continuous The problem defines $f:(X,\mathcal{D}) \rightarrow (Y,\mathcal{T})$ where $\mathcal{D}$ is a discrete space and $\mathcal{T}$ is any topological space. I have to show that f is continuous. 
What I did was: 
For f to be continuous, then for each $\mathcal{T}$-open subset V of Y, $f^{-1}(V)$ is a $\mathcal{D}$-open subset of X
Since $(X, \mathcal{D})$ is a space then every subset of X is open (and hence closed)
Let V be a subset of $(X,\mathcal{D})$ such that $V \subset X$
Since V is both open and closed then $f^{-1}(V)$ is a closed subset of X
Thus f is continuous. 
I'm not sure if thats correct and for this specific question I really didn't know what to do so any input would be great. 
 A: You're not quite on target (though you have the right idea). For one thing, there's no way for you to know that an arbitrary $\mathcal T$-open subset $V$ of $Y$ is also $\mathcal T$-closed. For another, we don't actually care whether $V$ is $\mathcal T$-closed or not. Finally, remember that we need $V$ to be a $\mathcal T$-open subset of $Y,$ and not a subset of $X$.
Now, letting $V$ be a $\mathcal T$-open subset of $Y$, note that $f^{-1}(V)$ is necessarily a subset of $X$ by definition of $f$ and pre-image, and is necessarily $\mathcal D$-open by definition of $\mathcal D$. Thus, continuity follows by the result you mentioned.
A: If $V$ is a subset of $X$, the domain of $f$, how can it have a preimage under $f$? It's also not clear why $V$ should be both open and closed; for example, if $(Y,\mathcal{T})$ is $\mathbb{R}$ with the standard topology, $(0,1)$ is an open set which is not closed. You have absolutely no control over $Y$ and $\mathcal{T}$; the open sets could be like nothing anyone could possibly imagine.
Since you can't control $Y$ and its open sets, but you have information about $X$'s topology, I'd argue slightly differently. Let $V\subset Y$ be an arbitrary $\mathcal{T}$-open set. To establish continuity of $f$, you need to show that $f^{-1}(V)$ is open. A characteristic of the discrete topology is that singletons are open. Can you write the set $f^{-1}(V)$ as an arbitrary union of open sets?
