Finding domain of $f \circ g$ I am having a small question, please don't close this before answering, I just want to know whether its a matter of convention or not.
If $f(x) = \dfrac{1}{x}$ and $g(x) = \dfrac{1}{x}$
$ $
Then $f \circ g = x$
$ $
I think domain of $f \circ g $ is $\mathbb{R} - \left\{0\right\}$
$ $
But many ppl I know are having an opinion that domain is $\mathbb{R}$ 
$ $
Which is true, OR is it just a matter of convention.
 A: It's a matter of convention. Indeed, when you say $f(x) = 1/x$, you've not really specified $f$ (it might, for example, only be defined on the domain $x > 4.7$), but by convention, we treat the domain as "as much of the reals as possible" and infer that it's therefore all of $\mathbb R$. 
(Slightly amended) When you say that $f \circ g (x) = x$, you've actually written something wrong, in the sense that the function on the left does not have $x = 0$ in its domain, but the function implied by the expression on the right (namely $x \mapsto x$) does; that makes them not equal as functions. A better description of $f \circ g$ is 
$$
f \circ g (x) =  x  \text{ for  $x \ne 0$}
$$
because $x = 0$ is not in the domain of $g$. Better still, 
$$
f \circ g : \mathbb R - \{0\} \to  \mathbb R - \{0\} : x \mapsto x,
$$
although I have to admit that the choice of codomain here is somewhat arbitrary -- I could have made it $\mathbb R - \{0\} \to  \mathbb R$. There's really almost no consistency about this. Some folks want the codomain to be "as small as possible," others may prefer that it's as easy to specify as possible. 
But once again, convention (or at least some algebra teachers) often says "we do algebra to the formulas for $f$ and $g$, and deal with the result." But to be honest, I think that most practicing mathematicians would agree with you that the domain of $f$ does not include zero. 
A: For the classical definition of function composition, if $f,g$ are any functions, then the domain of $f\circ g$ is the domain of $g$, period (but see the last two paragraphs).
The issue here highlights the problem with the formulation "find the domain of a function" -- a function's domain is a part of its definition. You can't specify a function without specifying a domain.
The formulas you've written could denote functions ${\bf R}\setminus \{0\}\to {\bf R}\setminus \{0\}$, as they could denote functions ${\bf C}\setminus \{0\}\to{\bf C}\setminus \{0\}$ or ${\bf C}\cup\{\infty\}\to{\bf C}\cup\{\infty\}$ or even $\{1,243\}\to\{1,1/243\}$. This very formulation is a convention in mathematical education (and an unfortunate one at that). It could be fixed if the definition said that "the domain of $f$ is the maximal set of real numbers for which the formula is meaningful", or something of the sort.
To digress in a different direction: sometimes we consider families of partial functions and identify functions which differ on small sets. For example, if we consider the field of rational functions ${\bf R}(x)$ with "composition" $*$, then $\frac 1 x * \frac 1 x=x$. But this is not literally function composition, but either a formal multiplication or an operation on equivalence classes (in case of meromorphic functions, for example).
==Edit==
As John suggested, if the codomain of $g$ and the domain of $f$ do not agree, it is still possible to define $f\circ g$. In this case, the domain of $f\circ g$ is the preimage of the domain of $f$ by $g$. This extension of the usual definition of composition of functions is a special case of composition of binary relations. In this case, too, however, the domain of $f\circ g$ is contained in the domain of $g$.
A: One sensible way to resolve this issue is to understand what the equation $f \circ g(x)=x$ does and does not say. It does not say "the function $f \circ g(x)$ is the same as the function $x$". By being careful about domains, what this equation does say is that "the function $f \circ g(x)$ is the same as the restriction of the function $x$ to the domain of $f \circ g(x)$", and that domain is the set $\mathbb{R}-\{0\}$, as stated in other answers.
A: Functions are like input output machines and composite functions are a combination of them. Thus when you consider f(g(x)), the domain cannot be greater than the domain of g(x) because if g(x) cannot process a x value then how can f(g(x))?
It does not do to just simplify composite functions because if f(g(x)) = x then can't we just make another function named h(x) =x but we don't. Why? so that the function f(g(x)) depends on the domain of the functions f(x) and g(x).
