In a book I saw a question along with solution
The question is
Let f,g,h be function from R to R , then show that (f+g)oh = (foh).(goh)
But when I saw the solution i got confused , they have cancelled the term x from both sides how ? 
In a book I saw a question along with solution
The question is
Let f,g,h be function from R to R , then show that (f+g)oh = (foh).(goh)
But when I saw the solution i got confused , they have cancelled the term x from both sides how ? 
On
I hope this will clear up some misunderstanding about what you call "cancelling $x$".
If you prescribe functions $u:\mathbb R\to\mathbb R$ by $x\mapsto\sin x$ and $v:\mathbb R\to\mathbb R$ by $x\mapsto\cos(x-\frac12\pi)$ then: $$u=\{\langle x,\sin x\rangle\mid x\in\mathbb R\}=\{\langle x,\cos(x-\frac12\pi)\rangle\mid x\in\mathbb R\}=v$$
Sometimes this is expressed as $u(x)=v(x)$ where $x$ is looked at as a variable ranging over domain $\mathbb R$. This expression is tricky in the sense that $f(x)=g(x)$ can also be used to express that eventually distinct functions $f$ and $g$ take the same value at $x$. In that interpretation $x$ must not be looked at as a variable, but as fixed element of the domain.
Remember that two functions are identical if they have the same domain (which, in your case, they do) and the same values.
So, all you have to prove is that for every $x$ in $\mathbb R$, the value $((f+h)\circ h)(x)$ is the same as the value $(f\circ g + g\circ h)(x)$.
There is no "canceling of $x$" anywhere. The proof is a typical proof of a statmenet of the form "for all $x$, $P(x)$ is true":