Show that the set $$A=\left\{\frac ab | a,b \in Z^+ , \frac{a^2}{b^2}<2 \right\}$$ has a least upper bound $L$
My try: $$\frac{a^2}{b^2}<2$$ $$\frac{a^2}{b^2}<(\sqrt2)^2$$ $$-\sqrt2<\frac{a}{b}<\sqrt2$$ But $a,b >0$ so $\frac ab >0$
Thus, we get $$0<\frac ab<\sqrt2$$ which implies $$\sup A = \sqrt 2 = L$$ So, $L$ exists. Hence proved.
I wonder is my proof correct or not ? Or is there any other specific way to solve it using definitions in the real analysis
The least upper bound $L$ exists by definition of the real numbers, which have as their defining axiom that every set which has some upper bound actually has a least upper bound.
This is, in fact, how one defines $\sqrt{2}$ - so strictly speaking your proof is incorrect, since you're invoking the existence of some real number called $\sqrt{2}$ which is by definition exactly the least upper bound $L$ you're trying to construct.
A proof should go as follows: the set $A$ is a set of rational numbers and hence is a subset of $\mathbb{R}$ (by definition of $\mathbb{R}$). It has an upper bound - for example, 2 is an upper bound, since either $\lvert a/b\rvert \leq 1$, or $a/b\leq a^2/b^2 <2$ by definition of the set.
Since $A$ has some upper bound, and is a set of real numbers, by the axiom of completeness of the real numbers there exists a least upper bound (usually denoted $\sqrt{2}$).