Continuity and Supremum 
Attempt:
I can't seem to gauge the points of continuity, for the attain supremum parts, I know I need to use the fact a continuous function on a closed, bounded interval is bounded and attains its sup/inf.
Any help will be appreciated, thanks.
 A: First note, that $g(x)$ is continuous at $x\neq n\pi$ because for each $x\neq n\pi$ there is an open interval around of $x$ where $g$ has the form $g(x)=\sqrt{|x|}\sin\left(\frac 1{\sin(x)}\right)$ (the set $\mathbb R \setminus \{n\pi:n\in\mathbb Z\}$ is open). Any concatenation of continuous functions is also continuous so that $g$ is continuous in this open interval and thus also in $x$.
Now take $x=0$. We have $\lim_{a\to0}\sqrt{|a|}=0$ and thus $\lim_{x\to0}\sqrt{|x|}\sin\left(\frac 1{\sin(x)}\right)=0$ because the sine function is bounded. So $g$ is continuous at $x=0$.
Take $x=n\pi$ with $n\neq 0$. You have $\lim_{x\nearrow n\pi} \frac{1}{\sin(x)}$ either being $+\infty$ or $-\infty$. Thus $\lim_{x\nearrow n\pi} \sin\left(\frac{1}{\sin(x)}\right)$ does not exist. Because $x\mapsto \sqrt{|x|}$ is continuous, also $\lim_{x\nearrow n\pi} \sqrt{|x|}\sin\left(\frac{1}{\sin(x)}\right)$ does not exist from which follows that $g$ is not continuous at $x=n\pi$ for $n\neq 0$.
Update: Note the following:


*

*$x\mapsto \sqrt{|x|}$ attains its supremum on $[0,\pi]$ at $x=\pi$.

*$\sin\left(\frac{1}{\sin(x)}\right)$ attains each value between -1 and 1 infinitely often as $x\nearrow\pi$


From both statements you can prove that $g(x)$ does not attain its supremum or infimum ($\pm \sqrt{\pi}$) on $[0,\pi]$.
