$\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?
 A: Yes it is the correct approach , since the function is continuous , specially at $x=0$. 
Remember , quotients, products, sums of continuous functions remain continuous. (As long as there is no domain problem)
You can just safely put $x=0$ directly without having to check for left hand and right hand limits separately. Also , since plugging $x=0$ does not cause any domain problems , you're good to go ! 
$$\lim_{x \to 0}(x\sec x)=0$$
This can also be seen as -
$\lim_{x \to 0}(x\cdot{sec(x)})=\lim_{x \to 0}\left(\frac{x}{cos(x)}\right)$
Now using the McLaurin series for Cosine function , we have 
$$\lim_{x \to 0}\left(\frac{x}{1-\frac{x^2}{2!}+\frac{x^4}{4!}\cdots}\right)=0$$
A: 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.
A: $$\lim_{x \to 0}(x\sec x)=\lim_{x \to 0}x\cdot\frac{1}{\cos x}=\lim_{x \to 0}\frac{x}{\cos x}=0$$
A: It is correct as long as you can justify it. You have theorems such that:


*

*$f (x)=x $ is continuous on the whole $\mathbb R $

*$f (x)=\cos x $ is continuous on the whole $\mathbb R$

*If two functions $f (x ) $ and $g (x) $ are continuous at $x=x_0$ and $g (x_0)\ne 0$, then the function $h (x)=\frac {f (x)}{g (x)} $ is also continuous at $x=x_0$.


Using all those, we prove that $f (x)=x\sec x=\frac {x}{\cos x} $ is continuous at $x=0$, which by definition of continuity means that $\lim_{x\to 0}f (x)=f (0) $, and so you can substitute $x=0$ instead of calculating the limit. 
To re-iterate, it is the continuity of the function $x\sec x $ at $x=0$ (which we can prove) that allows you to do that substitution. Beware other problems, where it may not hold!
