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.
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
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.