If exist, find$\sup S\;\&\;\inf S$ $$S=\left\{\frac{1}{x^2+\left\lceil\frac{2n+2}{n+2}\right\rceil x+2-\frac{\cos(n\pi)}{n^2}}:\;x\in\left(-2,-\frac{1}{2}\right),\ n\in\Bbb N\right\}$$
My attempt: $$\frac{1}{x^2+\left\lceil\frac{2n+2}{n+2}\right\rceil x+2-\frac{\cos(n\pi)}{n^2}}=\frac{1}{x^2+\left\lceil2-\frac{2}{n+2}\right\rceil x+2-\frac{(-1)^n}{n^2}}=\frac{1}{x^2+2x+2+\frac{(-1)^{n+1}}{n^2}}$$ $$f(x):=x^2+2x+2,\;\min\{y:y=f(x)\}=f(-1)=1,\ \ \ -1\in\left( -2,-\frac{1}{2}\right)$$ $n=2:$ $$x^2+2x+2+\frac{(-1)^{n+1}}{n^2}\geqslant\frac{3}{4}\implies\frac{1}{x^2+2x+2+\frac{(-1)^{n+1}}{n^2}}\leq\frac{4}{3}\implies\sup S=\frac{4}{3}$$ $$f(-2)=2\;\&\;f\left(-\frac{1}{2}\right)=\frac{5}{4}$$ $n=1:$ $$x^2+2x+2+\frac{(-1)^{n+1}}{n^2}\leq3\implies\frac{1}{x^2+2x+2+\frac{(-1)^{n+1}}{n^2}}\geqslant\frac{1}{3}\implies\inf S=\frac{1}{3}$$ $$\implies S=\left[\frac{1}{3},\frac{4}{3}\right]$$ Is this correct?
A general observation is that your proof would benefit massively from having some text in it rather that a wall of formulae. In it's current state it doesn't really prove anything : there are no arguments linking the formulae together. The arguments might seem obvious to you, but you must make an effort to write them down especially when someone else has to read your proof.
For example this implication is not obvious to me
$$\frac{1}{x^2+2x+2+\frac{(-1)^{n+1}}{n^2}}\leq\frac{4}{3}\implies\sup S=\frac{4}{3}.$$ To use this you'd like the inequality on the l.h.s.to be true. You don't prove this. Secondly even if you show that it is true I'd argue that you've only proven that $4/3$ is an upper bound and not necessarily the least upper bound as you claim it is.
For others to understand your proof you must write at least a few words ! Where does 4/3 come from ? Why is the inequality true ? Why can we deduce $\sup S = 4/3$ from the inequality ...
Here's a proof :
As you showed $S$ is simply
$$ S = \left \{Q_n(x) = \frac{1}{x^2 + 2x + 2 + \frac{(-1)^{n+1}}{n^2}} : x \in I = (-2,-1/2), n \in \mathbb N\right\}.$$
Consider the denominator as a polynomial $p_n(x)= x^2 + 2x + c_n$. This polynomial has no roots so $x^2 + 2x + c_n > 0 \forall n,\forall x$. This means the $n,x$ that maximise $Q_n(x)$ are those that minimise $p_n(x)$. For a fixed $n$, $p_n$ has a unique minimum at $x = -1 \in I$ so $\forall n \in \mathbb N,\forall x \in I: Q_n(x) \leq Q_n(-1).$ Notice that $$Q_n(-1) = \frac{1}{1 - 2 + 2 + \frac{(-1)^{n+1}}{n^2}} = \frac{1}{1+\frac{(-1)^{n+1}}{n^2}}.$$ By similar arguments to maximise $Q_n(-1)$ we must minimise the denominator. Obvisouly this is done when $\frac{(-1)^{n+1}}{n^2}$ is negative and $n$ as small as possible i.e. when $n = 2$. Therefore $$ Q_n(x) \leq Q_n(-1) \leq Q_2(-1)= \frac 4 3 \implies \sup S \leq \frac 4 3.$$ Since $Q_2(-1) \in S$ we also have $ \frac 4 3 \leq \sup S$ so $$ \sup S = \frac{4}{3}.$$
To find the infimum we try maximise $p_n(x).$ By our previous study of $p_n(x)$ we know that $$ \forall x \in (-2,-1/2) , \forall n : p_n(x) < \max(p_n(-2),p_n(-1/2))$$ (it is important to notice that it is $<$ and not $\leq$ in this inequality). Since $-2$ is the furthest from $-1$ we must have $$ p_n(x) < p_n(-2) = 4 - 4 + c_n = 2 + \frac{(-1)^{n+1}}{n^2}$$ which has it's greatest value when $(-1)^{n+1}$ is positive and $n$ as small as possible i.e. when $n = 1.$ So we have found an lower bound for $S$: $$ p_n(x) < p_1(-2) = 3 \iff Q_n(x) > \frac{1}{3} = Q_1(-2).$$ Since $\inf S$ is the greastest lower bound we have $\forall n \in \mathbb N, x \in I:$ $$ Q_n(x) \geq \inf S \geq \frac{1}{3}.$$ Take $n = 1$ and a limit $x \to -2$ to obtain $$ Q_n(-2) \geq \inf S \geq Q_1(-2)$$ so $\inf S = \frac{1}{3}.$
There is another less important problem. You claim $S = [\inf S, \sup S]$ this is not necessarily the case since you've only shown $S \subseteq [\inf S, \sup S]$ it could well be that $S$ isn't even an interval (I haven't checked though).