generalized way of finding minimum value of a function? $f(x)=\frac{x^{2}-1}{x^{2}+1}$ for every real number for $x$, the minimum value of $f$ is what?
How  can I find the minimum value of this function.I only know trial and error method, but it's not a generalized way. 

Please tell me a generic way to solve this type of problem
This case is so simple, it can be solved without even using calculus.
Write $f(x)$ as
$$f(x)= 1- \frac{2}{x²+1} $$
The minimum value of this function clearly occurs when the fraction on the right is greatest, which clearly occurs when the value of the denominator is least, which happens when $x=0$ Hence, the minimum value of the function is $f(0)=-1$.
Others have covered how to solve the problem if $f$ is differentiable.
But what if it's not?

Employ a computer and find a local minimum using the hill climbing algorithm. Or use a variant of it like "Random-restart hill climbing" for an approximation of the global minimum.