I've been reading lecture notes on analysis and alongside a textbook by a different author. Both my professor and the author introduce the following proof by contrapositive:
Let $f: \mathbb{R}^n \rightarrow \mathbb{R}$ be a continuous function, then $\forall c \in \mathbb{R} $, the level set $N_c=f^{-1}(\{c\})$ is closed.
Proof: Let $a\in \mathbb{R^n} $ such that $a \notin N_c$. We will prove that any such $a$ is not a limit point of $N_c$. Now let $f(a)=b$ and, directly as a consequence $b \neq c$. Then let us define $\epsilon= d(b,c)>0$. Notice that $c \notin B(b, \epsilon)$.
From continuity we observe that $\lim_{x \to a}f(x)=f(a)=b$. We now know $\exists \delta >0$ such that $f(B(a,\delta)) \subset B(b, \epsilon)$.
Then we see that $c \notin f(B(a,\delta))$. This in turn implies that $B(a, \delta) \cap N_c = \emptyset$. By definition, this means that $a$ is not a limit point of $N_c$.
This concludes the proof, because notice that the contrapositive of $a \notin N_c \rightarrow \text{a is not a limit point of $N_c$}$, is what we wanted to prove. Because if $a$ is a limit point, it is in $N_c$, consequently $N_c$ is closed since it contains all its limit points
This proof by contrapositive did not feel that satistfying, are there other proofs where we can directly prove the desired property or is the above mentioned method really the traditional way to go?
Note that already being "closed" is something "contrapositive". As a rule of thumb, it is much easier to prove that a set is open (if true) than it is to prove that its complement is closed.
Your own proof, while correct, is told in a somewhat cumbersome fashion. It should not take more than three lines.
If $a\notin N_c$ put $\epsilon:=|f(a)-c|>0$. As $f$ is continuous at $a$ there is a $\delta>0$ such that $|f(x)-f(a)|<\epsilon$, hence $f(x)\ne c$, for all $x\in U_\delta(a)$. This shows that $U_\delta(a)$ does not intersect $N_c$. Since $a\notin N_c$ was arbitrary we conclude that $N_c$ is closed.