continued fractions give the best rational approximations to numbers.
Considering for example $0<x<1$, and let $T(x)=\frac{1}{x}-\lfloor \frac1x\rfloor$, where $\lfloor \cdot\rfloor$ is the floor function (a.k.a. maximum integer function).
Then
$$x=\frac{1}{1/x}=\frac{1}{\lfloor \frac1x\rfloor + Tx}=\frac{1}{a_1 +Tx}$$
where $a_1(x)=\lfloor \frac1x\rfloor$. Continuing this way, and as long as $T^{n-1}x=T(T^{n-2}(x))\neq0$, let $a_n(x)=\lfloor \tfrac{1}{T^{n-1}x}\rfloor$. We obtain the sequences of rational numbers
$$ x_n:=\frac{1}{a_1+\tfrac{1}{a_2 +\ddots\tfrac{1}{a_{n-1}+\tfrac{1}{a_n}}}}$$
It turns out that the rational approximations $x_n$ in some sense that can be made very precise:
- If $x$ is rational, the sequence $x_n$ is final after a finite number of steps.
For irrational $x$, the sequence $x_n$ is infinite and
- $x_n=\frac{p_n}{q_n}$ where
\begin{align}
p_n&=a_np_{n-1}+p_{n-2}\\
q_n&=a_nq_{n-1}+q_{n-2}
\end{align}
with $p_0=0$, $p_1=1$, $q_0=1$ and $q_1=a_1$.
- It is relatively easy to check that $m.c.d(p_n,q_n)=1$ for all $n\geq0$.
- With a little more effort we have the bounded
$$\frac{1}{q_nq_{n+2}}<\Big|x-\frac{p_n}{q_n}\Big|<\frac{1}{q_nq_{n+1}}$$
That the rational $x_n$'s are the best rational approximations to $x$ is expressed in the following result
Theorem: If there is a rational number $a/b$ with $b>0$ such that
$$\big|x-\frac{a}{b}\big|<\big|x-\frac{p_n}{q_n}\big|$$
for some $n>0$, then $b>q_n$.
A classic example is the golden mean $\phi:=\frac{\sqrt{5}-1}{2}$ which can me expressed as
$$\phi:=\frac{1}{1+\frac{1}{1+\frac{1}{1+\ldots}}}$$
It is customary to use the notation $[a_1a_1\ldots]$ for the number $x$; other notations are $\frac{1}{a_1+}\frac{1}{a_2+}\cdots$.
A fun fact (easy to prove) is that if the continued fraction of a number is periodic, that is there is a pattern $a_{n_0}\cdots a_{n_0+k}$ that repeats (similar to periodic decimal expansions) then the irrational number it represents solves a quadratic question with integer coefficients, and vice versa.
Example: the golden mean $\phi$ satisfies $x=\frac{1}{1+x}$, or equivalently $x^2+x-1=0$
Example: $\sqrt{2}-1=\frac{1}{2+\frac{1}{2+\frac{1}{2+\ldots}}}$ satisfies $x=\frac{1}{2+x}$ , or equivalently $x^2+2x-1=0$
The number in your OP, $\beta=\sqrt{1+\sqrt{2}}$ does not solve a quadratic equation by a quartic: $x^4-2x^2-1=0$. Its continued fraction expansion is not periodic. This requires more finesse. There are very good algorithms nowadays that can produce large amounts of integers in the continued fraction of several algebraic numbers. Here is the first 10 elements of the continued fraction of $\beta-1=[1,1,4,6,1,2,2,2,1,1,6,\ldots]$.
Using also fine numerical methods to solve equations, can give you approximations for algebraic and wet known transcendental numbers in decimal expansion with different levels of accuracy.
The answer given in the different posting of course shoes that any irrational number can be approximated by rationals. This is a trivial fact due to the density of rationals in the real line (the kind of stuff cover in a course of Calculus or undergraduate Analysis). However, it is useless in practice for it does not tells you how to approximate numbers by irrationals, and how good the approximation is.
There are irrational numbers that are hard to approximate, the golden mean $\frac{\sqrt{5}-1}{2}$ being the hardest (in the sense of the theorem above). It is a delicate problem in fine numerical analysis, dynamical systems, and many applications in physics to have good approximations to irrational numbers, for systems may be extremely sensitive to errors.
I hope this motivates the OP to do some digging into continued fractions. Classic high school books such as Hall, H.S. and S.R. Knight, Higher Algebra, 1889 (Now edited by USA public domain selection), and Uspenski's Theory of equations dedicate a few chapters to this topics. The classic book on the subject is a book Perron, O., Die Lehre von den Kettenbrüchen, 1913. Another short and nice treatment appears in Vinogradov, I. Elements of Number Theory, English translation, Dover.