f:$\mathbb{R} \rightarrow \mathbb{R}$ such that f(x)=a, for all x$\in\mathbb{R}$ is continuous function.
$\mathbb{Q}$ is a subspace of $\mathbb{R}$ and hence f:$\mathbb{Q} \rightarrow \mathbb{R}$ such that f(x)=a, for all x$\in\mathbb{Q}$ is also continuous function with respect to subspace topology.
Using sequential continuity i can see that the function f:$\mathbb{Q} \rightarrow \mathbb{R}$ such that f(x)=a, for all x$\in\mathbb{Q}$ is continuous.
But if i will think in this way , {a} is closed in $\mathbb{R}$ and under continuous function inverse image of closed set is closed that is $f^{-1}$(a)=$\mathbb{Q}$ is closed. which is not possible because $\mathbb{Q}$ is not closed subspace of $\mathbb{R}$. hence f:$\mathbb{Q} \rightarrow \mathbb{R}$ such that f(x)=a, for all x$\in\mathbb{Q}$ is not continuous. where i am going wrong.