I would be grateful if someone is willing to check my solution to the following problem:
Let $n \in \mathbb{N}$, two orthogonal vectors $\mathbf{c}, \mathbf{d} \in \mathbb{R}^{n}, \mathbf{c} \neq 0, \mathbf{d} \neq 0$ .
Define the function $\psi: \mathbb{R}^{n} \longrightarrow \mathbb{R}$ by: $$ \psi(\mathbf{x})=\|\mathbf{x}\|^{2}-\langle\mathbf{d}, \mathbf{x}\rangle, \quad \forall \mathbf{x} \in \mathbb{R}^{n} . $$
Prove that the following set is closed: $$ \left\{\mathbf{x} \in \mathbb{R}^{n} ;\langle\mathbf{c}, \mathbf{x}\rangle=0, \text { and } \psi(\mathbf{x}) \leq 0\right\}\\ $$
My attempt:
Writing the terms explicitly and making a "merge" of both conditions: $$ \left\{\mathbf{x} \in \mathbb{R}^{n} ;\psi(\mathbf{x}) \leq \langle\mathbf{c}, \mathbf{x}\rangle\right\}\\= \left\{\mathbf{x} \in \mathbb{R}^{n} ; \|\mathbf{x}\|^{2}-\langle\mathbf{d}, \mathbf{x}\rangle \leq\langle\mathbf{c}, \mathbf{x}\rangle\right\}\\ =\left\{\mathbf{x} \in \mathbb{R}^{n} ;\|\mathbf{x}\|^{2}-\langle\mathbf{d}, \mathbf{x}\rangle-\langle\mathbf{c}, \mathbf{x}\rangle \leq 0\right\} $$
Define $$ \begin{aligned} &g: \mathbb{R}^{n} \longrightarrow \mathbb{R} \\ &x \longmapsto\|\mathbf{x}\|^{2}-\langle\mathbf{d}, \mathbf{x}\rangle-\langle\mathbf{c}, \mathbf{x}\rangle \end{aligned} $$
Now $g$ is continuous as the inner product is (and so does the norm which the inner product induces).
Is it possible to say that since the set above is actually $ g^{-1}((-\infty, 0]) $, then it is a preimage of continuous function on a closed set and hence is closed?
Thank you
Your set is the intersection of the sets$$\{\mathbf x\in\Bbb R^n\mid\langle\mathbf c,\mathbf x\rangle=0\}\tag1$$and$$\{\mathbf x\in\Bbb R^n\mid\psi(\mathbf x)\leqslant0\}.\tag2$$All you need to do then is to prove that both $(1)$ and $(2)$ are closed sets. But if $\varphi\colon\Bbb R^n\longrightarrow\Bbb R$ is the function defined by $\varphi(\mathbf x)=\langle\mathbf c,\mathbf x\rangle$, then$$(1)=\varphi^{-1}\bigl(\{0\}\bigr)\quad\text{and}\quad(2)=\psi^{-1}\bigl(]-\infty,0]\bigr).$$So, since $\varphi$ and $psi$ are continuous and $\{0\}$ and $]-\infty,0]$ are closed subsets of $\Bbb R$, $(1)$ and $(2)$ are indeed continuous.
Concerning your attempt, I see no reason why your equalities between sets would hold.