Let $X$ a topological space. Recalling that $Y\subset X$ is a "fixed point set" if there is a continuous map $f:X \longrightarrow X$ such that $f(x)=x$ if, and only if, $x\in Y$, in the paper
http://msp.org/pjm/1980/89-1/pjm-v89-n1-p16-s.pdf
is shown that a 1-dimensional Peano cotinuum (i.e., a compact, connected and locally connected), put $X$, has the following property: every closed subset $Y\subset X$ is a fixed point set (that is, there is a continuous map $f:X \longrightarrow X$ such that $Y$ is the fixed point set of $f$). In other words, $X$ has the complete invariance property.
However, I think that such result may be false for precompact, connected but not locally connected sets. In fact, I think that the topologist's sine
$X=\{(x,\sin(x^{-1})):x\in (0,1]\}\cup \{(0,y):y\in [-1,1]\}$
can be a such example. What do you think? Is not very difficult to show that the above set has the "fixed point preperty" (recall, each continuous map from $X$ into itself has some fixed point), but this is not the question.
Many thanks for your time!