Here's the simplest possible example:
Consider the space $X$ with three points $a,b,c$ and open sets $$\emptyset, \\{a\\},\\{c\\}, \\{a,c\\}, \\{a,b,c\\}.$$ Let $A=\\{a,c\\}$. There are only two maps from $X$ to $A$ which are the identity on $A$, and neither is continuous. E.g. if we send $b$ to $a$, then the preimage of the open set $\\{a\\}$ is the non-open set $\\{a,b\\}$.
This really is the simplest example, since any space retracts onto any of its singleton subsets and onto itself.