I stumbled upon this question from a previous exam in my Real analysis course.
Let $f \colon (0, 1] \to [0, 2]$ defined by $f (x) = 1 + (1 − x) \sin (1 /x)$
Prove that $\sup f((0,1]) = 2$.
Prove that $\sup f ((0, 1]) = 2$ is not reached.
I was able to prove that $2$ is an upper bound for the function but I was not able to continue further. Part 2 was easy:
Assume by contradiction that there exists $x$ such that $f(x)=2$. that would mean that $\sin(1/x)= 1/(1-x)$ which is a contradiction because that would imply that $\sin(1/x)>1$.