Slightly equal functions Can there exist two elementary functions $f(x)$ and $g(x)$ defined everywhere on the real axis such that,
\begin{align} f(x)&=g(x)\qquad \text{if} \quad a\le x\le b\\
f(x)&\neq g(x)\qquad \text{if} \quad x<a\quad\text{or}\quad x>b\end{align}
where f(x) and g(x) are not piecewise defined functions. And $a\ne b$.
If yes, give example. If no, give proof.
Also, would it make any difference if the functions need not be elementary?
Edit : It seems there is a lot of confusion due to my inability of putting the question precisely. Please refer to the links.
Elementary functions http://en.wikipedia.org/wiki/Elementary_function
Piecewise defined function http://en.wikipedia.org/wiki/Piecewise
I have also added the 'defined everywhere' condition.
 A: $f(x) = x$
$g(x) = \arcsin(\sin x)$
Then: $f(x) = g(x)$, if and only if $x$ is in $[-\pi/2, \ \pi/2] $
Added in edit: Note that $f$ and $g$ are both defined and continuous for all reals. The graph of $g$ is a sawtooth.
A: Define "elementary", because $|x|$ (or $\sqrt{x^2}$) in my opinion is. A first pair I can think of is:
$f(x)=|x-1|=\sqrt{(x-1)^2}$
$g(x)=-|x-2|+1=-\sqrt{(x-2)^2}+1$
This makes them equal on the interval $[1,2] $, and different outside. Here is some plot:

A: (NB. The $a \neq b$ statement was added after this answer).
I believe this is the simplest counterexample if the problem is stated correctly.
$$f(x) = 0$$
$$g(x) = x$$
$$a = b = 0$$

Another example (depending on how you define piecewise) could be constructed using: $$f(x) = \sqrt{(x-1)^2}$$
$$g(x) = 1-\sqrt{(x-2)^2}$$
(as in another answer).
A: I define floor $\lfloor x\rfloor$ as the largest integer less than or equal to $x$.  This definition does not require pieces, and I believe it's as elementary as anything else.  And now:
$$f(x)=\lfloor x\rfloor$$
$$g(x)=0$$
