TITLE: Do these conditions imply function is continuous?
QUESTION [7 upvotes]: I have two separate conditions: 
a)
$\lim\limits_{h\to 0}|f(x+h)-f(x-h)|=0$ for every $x \in \Bbb R$ and 
b) $\lim_\limits{h\to 0}|f(x+h)+f(x-h)-2f(x)|=0$  for every $x \in \Bbb R$. 
My question is do the each of them imply $f$ is continuous?  $f(x)$ is said to be continuous at $x_0$ if $\lim_\limits{x\to x_0} f(x) = f(x_0) = c$ For a) it seems correct but I don't know how to prove it. For b), it seems wrong but I can't think of a counterexample.

REPLY [12 votes]: Both of them do not imply continuity.
For (a), consider $f(x)=a$ for $x \ne x_0$ and $f(x_0) =b \ne a$.
A simple example may be $f(x)=0$ for $x \ne 0$ and $f(0) =1$.
For (b), consider $f(x)=c$ for $x>x_0$ and $f(x)=d \ne c$ for $x<x_0$ and $f(x_0)=\frac{c+d}{2}$.
A simple example may be $f(x)=1$ for $x>0$ and $f(x)=-1$ for $x<0$ and $f(0)=0$.
Both are counterexamples that satisfy your conditions but are not continuous at $x=x_0$.