How to find the domain and the range of this function$f(x)=\sqrt{5-\frac{x^2}{x^2+2}}$ algebraically? help how to find the domain and the range of this function algebraically

$$f(x)=\sqrt{5-\frac{x^2}{x^2+2}}$$
It amounts to finding the domain and range of $f(x) = \dfrac{x^2}{x^2+2}$. Clearly the domain is all $\mathbb{R}$, and for the range, $0 \le f(x) &lt; 1\implies 0 \ge -f(x) &gt; -1\implies \sqrt{5-\dfrac{x^2}{x^2+2}}= \sqrt{5-f(x)}\in(2,\sqrt{5}].$
hint

$$5-\frac{x^2}{x^2+2}=2(2+\frac{1}{x^2+2})\ge 0$$
the domain is $\Bbb R$.