A linear functional $f$ on a normed space $X$ is said to be bounded if there is a constant $K\gt0$ such that $$\vert f\vert \le K \|x\|,\quad\forall x\in X\tag{1}$$
The smallest constant $K$ for which $(1)$ holds is called the norm of $f$. Then,
$$\|f\|=\sup\left\{\frac{\vert f(x)\vert}{\|x\|}:x \ne 0,x\in X \right\}\tag{2}$$
or equivalently $$\|f\|=\sup\left\{\vert f(x)\vert:\|x\|=1 ,x\in X \right\}\tag{3}$$
I'm not getting how $(2)$ and $(3)$ are equivalent?
This follows from the linearity of $f$ and the properties of the norm: note that $$ \frac{|f(x)|}{||x||}=\Big|\,f\Big(\frac{x}{||x||}\Big)\Big|=|f(u_x)| $$ where $u_x=\frac{x}{||x||}$ satisfies $||u_x||=1$. Therefore taking the supremum over either set yields the same result:
Indeed, if we let $$ S_1=\sup\{\frac{|f(x)|}{||x||}:x\neq 0\}$$ and $$ S_2=\sup\{|f(x)|:||x||=1\} $$ then $S_2\leq S_1$ since the second set is contained in the first. But on the other hand, for any $x\neq 0$ we have $$ \frac{|f(x)|}{||x||}=|f(u_x)|\leq S_2 $$ so taking the supremum over all $x\neq 0$ yields $S_1\leq S_2$.