TITLE: Are there general position results in singular algebraic sets?
QUESTION [5 upvotes]: Let $X$ be a real algebraic set, and let $Y \subset X$ be its singular set.  In this question I'll focus on the analytic topology, so we can just imagine that $X$ is the zero set, in $\mathbb{R}^n$, of a certain polynomial $f(x_1, \ldots, x_n)$ with real coefficients.  It's a classical result that $X$ can be triangulated with $Y$ as a subcomplex.  Here is my question:

If $Y$ has codimension $d$ in $X$ (i.e. $X$ has dimension $n$ as a simplicial complex and $Y$ has dimension $n-d$) and $f: M^m\to X$ is a continuous map from a closed manifold of dimension $m\leq  d-1$, is $f$ necessarily homotopic, inside $X$, to a map $g: M^m\to X\setminus Y$?

I rather doubt that this is true in full generality.  I'd be quite interested in counterexamples (the simpler the better!) or any partial results of this nature.  
Note that if $X$ were a smooth manifold and $Y$ were a submanifold, a positive answer to the question is one of the standard consequences of Thom's transversality theorem.
The question could be asked more generally for simplicial complexes $Y\subset X$.  In this generality it's clearly false: let $X = Z \vee Z$, where $\pi_1 Z \neq 0$, and let $Y$ be the wedge point.  Then $\pi_1 X = \pi_1 Z * \pi_1 Z$ and if $\gamma\in \pi_1 Z$ is non-trivial, every loop representing $\gamma*\gamma$ must pass through the wedge point $Y$.  Here's a second question: is there an example of this form in which $X$ is actually a real algebraic set?
Finally, I'll mention that Lemma 2.5 of this paper gives a result somewhat along the lines I'm looking for, but just deals with loops in simplicial complexes (under somewhat strong hypotheses).

REPLY [3 votes]: What about $X$ given by the equation 
$$ (x_1^2 + \ldots + x_n^2)(y_1^2 + \ldots + y_n^2) = 0? $$
This is a wedge of $\mathbb{R}^n$ with itself, and $Y = \{0\}$. Then $X-Y$ is disconnected, so the claim is false with $M = S^0$. 
If you are not happy with $M$ being disconnected, you can take $M=S^1$ and use the above construction of $X\vee X$ where $X$ is your favorite variety with $\pi_1 X \neq 0$. As you said, there is a loop which will always pass through the origin.
Now I anticipate your question: what about $X$ irreducible in the Zariski topology? Then I don't know and I'm looking forward to see such examples in this thread.