Definition of continuity in topological spaces The definition is given as follows:

$f : X \to Y$ is continuous iff for every $U \in T$ the topology on Y, $f^{-1}(U) \in \delta , $ the topology on $X$. Thus a continuous function is characterized by inverse image of an open set is open.

First of all, how do we know that every $U \in T$ is an open set? A topology $T$ can also contain closed sets right? Shouldn't that be specified?
Discrete topology is defined as the following: "All open subsets of $X$ form a discrete topology".
For $f$ to continuous between two sets, we need to check for all open subsets of $Y$ that their inverse images are open sets. However if the topology $T$ is not discrete, there may be some open subsets that are not included in $T$. So checking for any open subset in $T$ wouldn't apply the whole function $f$ to be continuous on $Y$. So are we assuming that $T$ is a discrete topology here?
Suppose we are assuming $T$ is a discrete topology. Then we know that for $T$ to be a topology $Y \in T$ should hold. However what if $Y$ is a closed set? Then definition of discrete topology and topology contradicts themselves.
To conclude: I didn't understand the "open subset" intuition in Topology.
 A: Let $(X, \mathcal{T})$ be any topological space. All of the elements of $\mathcal{T}$ are called the "open sets" of $X$. 
Every $U \in \mathcal{T}$ is open, because that is the defintion of an open set, being an element of a topology. 
A "closed set" in $X$ is defined to be the complement of an "open set" in $X$. That is $V \subseteq X$ is "closed" if $X - U \in \mathcal{T}$.
Certainly a topology can have elements that are both open and closed sets. Two examples of this are $X$ and $\emptyset$ in the example above (and in any topology on a set,check to see why this is true)
It seems to me that your misconception is a common one, that most go through when first learning general topology, which is that some sets can be both open and closed in a topological space, and some can be neither, some can be open and not closed, and some can be closed and not open. 
If $Y$ is another set, the discrete topology on $Y$ is simply the power set $\mathcal{P}(Y)$, in the discrete topology all subsets of $Y$ are elements of the topology $\mathcal{P}(Y)$ and hence all subsets of $Y$ are open in $Y$

A good exercise to prove now, would be the following theorem, which is equivalent to the usual definition of continuity of a map between topological spaces.

Let $f : (X, \mathcal{T}) \to (Y, \mathcal{K})$ be a function between two topological spaces. Prove that $f$ is continuous if and only if for every closed $V$ in $Y$, $f^{-1}[V]$ is closed in $X$

