$\lim_\limits{x \to 0}(x\sec x)=0$? $$\lim_{x \to 0}(x\sec x)$$
So putting in $x=0$ you get the answer $0$.
$$\lim_{x \to 0}(x\sec x)=0$$
My question is is this a correct way to solve?
edit : So from the answers below, I've understood that if a function is continuous, then $\lim_{x \to a}f(x)=f(a)$
But how do you figure out if a function is continuous? 
from the graph? But what if it's a function that I don't know the graph of?

Yes. For continuous functions, you can just plug in the value, because you can switch a limit and a continuous function.
I.e., if $g$ is continuous, then $$\lim_{x \to a} g(f(x)) = g \left(\lim_{x\to a}f(x)\right)$$
provided the limit on the right exists and gives a value on which $g$ is defined.
