Prove that $a:=\inf \{x\in \mathbb Q: x^2\le 2\}$ satisfies $a^2 = 2$ 
Define $S := \{x ∈ \mathbb Q : x^2 ≤ 2\}$. Prove that $a:=\inf \{S\}$
  satisfies $a^2 = 2$.

Since a is a lower bound for S, we have $a^2\le 2$. if $a^2\neq 2$ then $a^2 < 2$ and we may set $\epsilon:= a^2 − 2 > 0$ and then I am not sure how to show it satisfies $a^2 = 2$.
 A: HINT.- $x^2\le2\iff-\sqrt2\le x\le \sqrt2$ and $(-\sqrt2)^2=(\sqrt2)^2=2.$
A: Consider $a=-\sqrt{2}$ and show that $a=\inf\{S\}$. This is equivalent to showing that


*

*for every $x\in S$, it holds that $x\ge -\sqrt{2}$.

*for every $\epsilon>0$, there is $x\in S$ such that $x<-\sqrt{2}+\epsilon$.


The first one should be straightforward, for the second take $\epsilon>0$ arbitrary and consider $x=-\sqrt{2}+\epsilon/2$. 
Just note that $-\sqrt{2}\notin S$ since $-\sqrt{2}\notin \mathbb Q$, so $-\sqrt{2}$ is indeed an $\inf$ but not a $\min$ of set $S$.
A: It is possible to flesh out the reasoning in your question to solve a more general question.  Let $f:\mathbb{R}\to\mathbb{R}$ be a continuous function, and consider the set
$$
S_f = \{x\in\mathbb{Q} \,:\, f(x) \leq 0\}.
$$
If $S_f$ is nonempty and $S_f\not=\mathbb{R}$, then $x^* = \inf S_f$ satisfies $f(x^*) = 0$.  To apply this to your question, simply set $f(x) = x^2-2$.
To prove it, let $y^* = f(x^*)$.  Suppose $y^*>0$, and let $\epsilon=y^*/2$.  Because $f$ is continuous we can find $\delta$ such that for every $x\in[x^*, x^*+\delta]$, 
$$|f(x)-f(x^*)|<\epsilon.$$
In particular, $f(x) > y^*/2 > 0$.  In particular, $[x^*,x^*+\delta]\cap S_f = \emptyset$, so $x^*+\delta$ is a larger lower bound for $S_f$.  But $x^*$ is the greatest lower bound for $S_f$, so this is a contradiction.  We conclude that $f(x^*)\leq 0$.
On the other hand, if $y^*<0$ we let $\epsilon = -y^*/2$ and again choose $\delta$ such that for every $x\in[x^*-\delta,x^*]$, 
$$|f(x)-f(x^*)|<\epsilon.$$ 
In particular, for such $x$, $f(x) < y^*/2 < 0$.  Because $\mathbb{Q}$ is dense, we can find a rational number $q\in [x^*-\delta, x^*]$ such that $f(q) < 0$.  This implies that $x^*$ is not a lower bound for $S_f$, and thus cannot be the infimum.  This is a contradiction, so we must have $f(x^*) \geq 0$.
We conclude that $f(x^*)=0$, which is what we wanted to show.
