Let $(X,\|\cdot \|)$ be a complete (infinite-dimensional) normed vector space and $f:X\to\mathbb{R}$ a $C^1$ function, $c\in\mathbb{R}$, and for some $\epsilon>0$ denote $A:=f^{-1}[c-2\epsilon,c+2\epsilon]$, $B:=f^{-1}[c-\epsilon,c+\epsilon]$. Then of course both $A$ and $B$ are closed subsets and I want to prove that $\text{dist}(A^c,B)>0$, where $A^c$ is the complement set of $A$ and $\text{dist}(A^c,B):=\inf\left\{\|x-y\|;x\in A^c,y\in B\right\}$.
My attempt:
Suppose by contradiction that $\text{dist}(A^c,B)=0$, then by definition there exist two sequences $(x_n)\subset B$ and $(y_n)\subset A^c$ such that $\|x_n-y_n\|\to 0$, for example we can take such sequences in such a way that $\|x_n-y_n\|\leq 1/n$. We can assume that $y_n\in\partial A^c$. Since for $x\in A^c$ we have $g(x):=|f(x)-c|\geq 2\epsilon$ and for $x\in B$ we have $g(x)=|f(x)-c|\leq\epsilon$, the existence of such sequence seems impossible. So I've take the set U of all elements $x\in X$ such that $|f(x)-c|\in(\epsilon,2\epsilon+\delta)$ for some $\delta>0$, by continuity of $f$, $U$ is cleary open, so I've tried to show that there is some $n\in\mathbb{N}$ such that $x_n\in U$ (since $x_n$ is "converging" to $\partial A^c$, and $U$ is a neighborhood of $\partial A^c$), but I was not able to prove such assertion.
Is my attempt in the correct way? If not, what can I do to improve? I want some hints, thanks.