Take $X=\mathbb R$ with usual topology and $A=\mathbb Z$ with indiscrete topology. (The one in which only empty set and whole set are open). This is not continuous as the inverse image $i^{-1}(n-\epsilon,n+\epsilon)=\\{n\\}$ for any $n\in \mathbb Z$ and for some $0<\epsilon <1$ is not open in $\mathbb Z$ and hence $i$ is not continuous.