Gradient of tangent curves Let S be a set of points of $\mathbb{R}^{2}$ consisting of two $C^{1}$ tangent curves at a point P. Prove that $\nexists f:\mathbb{R}^{2}\to\mathbb{R}$ such that $S=f^{-1}(0)$ and $\nabla f(x)\neq0_{\mathbb{R}^{2}}$, $\forall x \in S$
I really don't know how to solve this problem. First of all, what does exactly mean "two $C^{1}$ tangent curves"?, I mean, this problem seems easy but I can't solve it.
 A: First, consider two tangent circles in the plane. They are $C^1$. This is an example for the posing of the problem.
Intuitively, the locus $f^{-1}(0)$ is a level curve and the gradient is always perpendicular to the level curves. Further, the point of tangency is a saddle point, so is, $\nabla f(P)=0$.
Consider a small ball around $P$, it contains pieces of both curves $\alpha$ and $\beta$. Because the curves are tangent, the gradient at $P$ is perpendicular to both. For points in the ball, $\nabla f(P)=0$ or
$\nabla f|_{\alpha(t+\epsilon)}\cdot\nabla f|_{\beta(s+\epsilon)}=k\vert\nabla f(P)\vert^2+O(\epsilon^2)$
With $k=1,-1$
If $k=1$ consider a curve $\gamma$ starting at some point of one of the curves and ending at some point of the other. Along $\gamma$, $f$ increases crossing one curve and increases again crossing the other, but at the crossing points $f(r)=0$, so $f$ has to be zero again between the crossing points, that is impossible as the curves are the only points at wich $f$ is zero.
If $k=-1$ following a path $\gamma$ analogous to the previous one, first $f$ increases crossing one curve but decreases crossing the other, so, there is an intermediate point for wich $\gamma'$ vanishes. This occurs no mind the size of the ball, then $\nabla f(P)=0$. Proving that with the conditions of the assertion, at least at one point the gradient vanishes.
A: This exercise is just asking you to show that $S$ is not a manifold. Since $f: \mathbb{R}^2 \to \mathbb{R}$, we know by the level-set theorem (or inverse function theorem) that $Df(p) = \nabla f(p)$ having rank $1$ i.e non-zero, implies $f^{-1}(f(p)):=M$ is a smooth manifold $2$-dimensional manifold. 
The fact that $S = C_1 \cup_p C_2$ allows us to first intuitively observe that this can't be a $2$-manifold since a neighborhood of $p$ looks like and  $\textbf{X}$ which is not homeomorphic to a disk. The user above provides details on the proof, but it is this intuition that you need to be starting with. I hope this helps. 
$\textbf{Sketch}$: Here is something different than the above solution. You have to fill in the details. Supposing $S = f^{-1}(0)$ and $\nabla f(p) = Df(p) \not = \textbf{0}$ then,
$$ Df^{-1}(\textbf{f}(p)) : T_{\textbf{f}(p)}\mathbb{R} \to T_{p}S$$
is an isomorphism. But $\textbf{dim}(T_{\textbf{f}(p)}\mathbb{R}) = 1$ and  so if we assume that the tangent vectors of $C_1, C_2$ at $p$ aren't parallel then, $\textbf{dim}(T_{p}S) = 2$ which is a contradiction. Hence no such $f$ exists. 
