Is the ''right limit'' function always right continuous? 
Let $f$ be a bounded function on $[0,1]$. Assume that for any $x\in[0,1)$, $f(x+)$ exists. Define $g(x)=f(x+)$, $x\in [0,1)$, and $g(1)=f(1)$. Is $g(x)$ right continuous? 

Prove it or give me a counterexample.
My ideas:
$(1)$If $f$ is of bounded variation, then $g$ must be right continuous.
$(2)$If the continuous points of $f$ are dense in $[0,1]$, then $g$ must be right continuous.
But I can not find a counterexample. Please help me. Thanks!
 A: Given any $\epsilon > 0$ and any $x \in [0,1)$, pick $\delta > 0$ such that $|f(y) - f(x+)| < \epsilon/2$ for all $y \in (x,x+\delta)$. For any $y \in (x,x+\delta)$, let $\{x_n\}$ and $\{y_n\}$ be two sequences approaching $x$ and $y$ respectively from the right. Then there exists an integer $N$ such that $x_n$ and $y_n$ lie  in $(x,x+\delta)$ for all $n>N$. For these $n$,
$$
|f(x_n)-f(y_n)| \leq |f(x_n)-f(x+)|+|f(y_n)-f(x+)| < \epsilon.
$$
By definition of $g$, we have
$$
|g(x)-g(y)| = \left|\lim_{n\rightarrow \infty}f(x_n) - \lim_{n\rightarrow \infty}f(y_n)\right| =  \lim_{n\rightarrow \infty} |f(x_n)-f(y_n)| \leq \epsilon
$$
for all $y \in (x,x+\delta)$. Hence $g$ is right-continuous. Note that we do not need $f$ to be bounded.
A: Define $f:[0,1] \to \mathbb{R}$ by
$f(x) = \begin{cases} 
      \ 1  \textrm{ if $x \in [0,1)$} \\
       \ -1 \textrm{ if $x \in [1/2,1]$} \\
   \end{cases}$
then $g(x)$ is well defined for all $x \in [0,1]$. It is not continuous, despite the fact that $g(1)=f(1)$.
A: We are assuming that $f(x+)$ exists.  Its definition is:
$f(x+) = q$ where $q\in [0,1)$, if $f(t_n) \to q$ as $n \to \infty$ for all {$t_n$} in $[x,1)$ s.t. $t_n \to x$
So try setting $g(x) = f(x+)$, then think about {$t_n$}
A: For $x\in [0,1)$ let $(x_n)_n$ be a sequence in $(x,1)$ converging to $x.$
For each $n$ let $x_n<y_n< \min (1, x_n+2^{-n}).$
Let $z_n\in (x_n,y_n)$ such that  $|f(z_n)-g(x_n)|<2^{-n}.$ 
Then $(\;f(z_n)\;)_n$ converges to $g(x)$ and $(\;f(z_n)-g(x_n)\;)_n$ converges to $0,$ so $(\;g(x_n)\;)_n$ converges to $g(x).$
