Consider $X = [0,1] \cup \{2\}$, $A = \{0,1,2\}$, and let $f:A \to A$ with $f(0)=0$, $f(1)=2$, $f(2)=0$. For any extension $g: X \to X$, $g([0,1])$ would not be connected so $g$ couldn't be continuous.