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.

EDIT: For a more general class of examples, let $X = Y \times [0,1]$ and $A = Y \times \{0,1\}$ for some $Y$ such that the maps $y \mapsto f(y, 0)_1$ and $y \mapsto f(y,1)_1$ from $Y$ to $Y$ are not homotopic.