If $f(x)=\frac{1}{g(x)}$ then $D_f \subset D_g$. Is this true? Let the domain of $g(x)$ be $D_g$ and $f(x)=\frac{1}{g(x)}$
I think that the domain of $f(x)$ is a subset of domain of $g(x)$ because 
1. $f(x)$ is not defined where $g(x)=0$. 
2. f(x) is not defined at those points where  $g(x)$ is not defined.
My brother said that 2. is wrong but he wasn't having any solid reason.
Kindly make me understand how 2. is wrong( not by giving an counter example because I already have one ).
I was doing trigonomentry, in that I found that $$\cot(x)=\frac{\cos(x)}{\sin(x)}$$ $x\ne n\pi$ where $n$ is an integer. 
Then I thought of writing $\cot(x)=\frac{1}{\tan(x)}$, from here I concluded that $\cot(x)$ is not defined when $\tan(x)=0$ and also where $\tan(x)$ is not defined but this is wrong. 
I need to understand that how $f(x)=\frac{1}{g(x)}$ is defined at those points where g(x) is not defined.
I know I'm making a little mistake but I don't understand that, please don't give the counterexample kindly make me understand where and how I'm making the mistake.    
 A: If $g$ has domain $D_g$ and $f$ is defined by $f = 1/g$, then $f$ has maximal domain--what we normally take to be the domain of the function--of $$D_f = D_g \cap \{ x \ | \ g(x) \neq 0 \} \subset D_g$$
In that sense as functions, $\tan \neq 1/\cot$. There are points in the domain of $\tan$ for which $\cot$ is not defined, e.g., $0 \in D_{\tan}$ but $0 \not\in D_{\cot}$.
What is true however is that for all $x \in D_{\tan} \cap D_{\cot}$, $\tan x = 1/\cot x$.

Added: Here's one definition of a function (there are other more formal definitions but this version contains the essential idea for your question):

$f : D \to C$ is a rule that associates to each $d \in D$, the domain, a member of $C$, the codomain. We write $f(d)$ for that member of $C$. 

Hence the two essential components of a function $f$ are the domain of $f$ and the 'rule' for the value of each value of the domain when acted on by $f$.
Thus
$$f_1 : [0,1] \to \mathbb R \quad \text{ with } f(x) = \sin(100x)$$
is a different function from
$$f_2 : \mathbb R \to \mathbb R \quad \text{ with } f(x) = \sin(100x)$$
because the domains are different. (Even though other things are the same, such as the codomain and the range, and that for every point $p$ in the intersection of the domains the functions agree, $f_1(p) = f_2(p)$).
The function $\tan$ has domain $D_{\tan} = \{ x \in \mathbb R \ | \  x \neq \pi/2 + k\pi, k \in \mathbb Z \}$. I.e., $\tan : D_{\tan} \to \mathbb R$. Similarly the function $\cot$ has domain $D_{\cot} = \{ x \in \mathbb R \ | \  x \neq  k\pi, k \in \mathbb Z \}$.
The function $TAN2$ defined by $TAN2 = 1/\cot$ has domain
$$D_{TAN2} = D_{\cot} \cap \{ x \in \mathbb R\ | \cot(x) \neq 0 \} \hspace{30 mm} \\ = D_{\cot} \cap \{ x \in \mathbb R  \ | \  x \neq \pi/2 + k\pi, k \in \mathbb Z \} \\ 
= \{ x \in \mathbb R  \ | \  x \neq  k\pi/2, k \in \mathbb Z \} \hspace{ 19 mm} $$
Are the functions $TAN2$ and ordinary $\tan$ equal? No! They cannot be because they have different domains. $D_{TAN2}$ is a strict subset of $D_{\tan}$.
That is, as functions
$$TAN2 = \frac{1}{\cot} \neq \tan$$
However at every point in the intersection of their domains, $D_{\tan} \cap D_{TAN2} = D_{TAN2}$, the rules for $TAN2$ and $\tan$ agree, i.e., 
$$\tan x = \frac{1}{\cot x}, \quad \text{ for all }  x \in \mathbb R \text{ with }  x \neq  k\pi/2, k \in \mathbb Z $$
Thus when we write
$$\tan x = \frac{1}{\cot x} \quad \text{ or } \quad \cot x = \frac{1}{\tan x}$$
what that means is "for every $x$ in the intersection of the domains of $\tan$ and $\cot$, those relations are true".
A: Without additional conditions, the statement implicitly means the domains are the same and the equality holds at each point of the common domain.
