Take any two continuous functions $f$ and $g$ from $\mathbb R$ to $\mathbb R$, such that $f(x) - g(x) > \epsilon > 0$ for all $x \in \mathbb R$, and define
$$h(x) = \begin{cases}
f(x) & \text{if } x \in \mathbb Q, \\
g(x) & \text{if } x \in \mathbb R \setminus \mathbb Q.
\end{cases}$$
Then, if I understand the definition correctly, $h$ will be upper semicontinuous at all rational points and lower semicontinuous at all irrational points, while being neither left nor right continuous anywhere. Or course, the same construction works equally well with any partition of $\mathbb R$ into dense subsets.
However, reading between the lines, I guess what you really want is an example of a function which
is (WLOG) upper semicontinuous everywhere,
is neither left nor right continuous as some point $x_0$, and
does not have a local extremum at $x_0$. The second Wikipedia example (involving a two-sided topologist's sine curve) almost works, though, and we can easily tweak it a bit to get
$$f(x) = \begin{cases}
(x^2+1) \sin (1/x) & \text{if } x \ne 0, \\ 1 & \text{if } x = 0.
\end{cases}$$
This function should satisfy the requirements given above for $x_0 = 0$.
Let $n=1$, let $f(x)=0$ on $[0,1]$ and $\frac{1}{x}$ for $x\in (1,\infty)$. Then we have
$$
|f|_{2}^{2}=\int^{\infty}_{1}\frac{1}{x^{2}}dx=-\frac{1}{x}|^{\infty}_{1}=1<\infty, |f|_{1}=\int^{\infty}_{1}\frac{1}{x}dx=\log[x]|^{\infty}_{1}=\log[\infty]=\infty
$$
On the other hand we may let $n=2$. If we let $f=0$ on $r\in (1,\infty)$ and $r^{-\alpha}$ on $r\in [0,1]$, we have
$$
|f|_{1}\sim \int^{1}_{0}r^{-\alpha}rdr,|f|_{2}^{2}\sim \int^{1}_{0}r^{-2\alpha}rdr
$$
We want that
$$
0<1-\alpha<1, 1-2\alpha<0
$$
This means
$$
\frac{1}{2}<\alpha<1
$$
and any $\alpha$ in this range should suffice. I am unable to construct an example for $n=1$, but I think this should be possible in principle.
Best Answer
Take some function $f \in C^0(\mathbb R) \setminus C^1(\mathbb R)$, for example $f\colon x \mapsto \left|x-\frac 12\right|$. Taking the antiderivative twice, gives you $$ F \colon x \mapsto \int_0^x \int_0^\xi \left|t - \frac 12\right| \, dt\,d\xi $$ which is in $C^3(\mathbb R) \setminus C^2(\mathbb R)$ (no, you don't want $C^2(\mathbb R)$-functions to be bounded). Restricting $F$ to $[0,1]$ gives you an example there.