Is $f(x)=\tan(x)$ monotonic or non-monotonic function? I have read that $f(x)=\tan(x)$ is monotonic function.
But in the graph of $f(x)=\tan(x)$ as we move across $\pi/2$ the graph moves from $\infty$
to $-\infty$, i.e  graph decreases but the definition for monotonic function says that it should either always increase or decrease.
Wouldn't this make $f(x)=\tan(x)$ non-monotonic?

I want to know a reason for this. Please check me if I'm wrong.
 A: Your teacher possibly means by “monotonic” that the function is monotonic over any interval completely contained in the function's domain. But I dare say it's not standard terminology.
Of course the tangent function is not monotonic according to the definition

for every $x$ and $y$ in the domain of $f$, if $x<y$ then $f(x)<f(y)$

because $0<3\pi/4$, but $0=\tan0>\tan(3\pi/4)=-1$.
On the other hand, the tangent function is monotonic (increasing) over any interval contained in its domain, because the derivative is $1/\cos^2x$, which is everywhere positive (on the domain), so the mean value theorem applies on every interval inside the domain.
Or your teacher specified that the tangent function is monotonic over $(-\pi/2,\pi/2)$ (so an inverse of the restriction thereon can be defined) and you neglected to note the specification.
A: Though there are confusions about this, as far as I know, we can define monotonicity only on intervals. Looking into Spivak's Calculus:

A function $f$ is [strictly*] increasing on an interval if $f(y)>f(x)$ for all $x$ and $y$ in the interval with $y>x$. (We often say simply that $f$ is increasing, in which case the interval is understood to be the domain of $f$.)

Now, the function $f(x)=\tan x$ is defined on $\mathbb R\backslash \left \{\frac{n\pi}{2}:n\in \mathbb N \right \}$ which is not an interval.
So, monotonicity of $f(x)=\tan x$ on $\mathbb R\backslash \left \{\frac{n\pi}{2}:n\in \mathbb N \right \}$ is not defined.
But, of course the function $g(x)=\tan x$ defined on $\left (\frac{-n\pi}{2},\frac{n\pi}{2}\right)$ is monotonic (increasing in fact).
