In definite integration, do I have to watch out for the behaviour of a function between the limits? 
Calculate -
$$\int^{1}_{-1}\frac{e^\frac{-1}{x}dx}{x^2(1+e^\frac{-2}{x})}$$

This is my approach-
Substitute $t=e^\frac{-1}{x}$
$$\therefore \int^{\frac{1}{e}}_{e}\frac{dt}{1+t^2}$$
which gives us $\frac{\pi}{2}- 2\arctan{e}$, but the answer given is $\pi- 2\arctan{e}$. I'm guessing that my wrong answer has something to do with the exponential term.

The answer to the question in the header is yes, and this is a really interesting example.
When you substitute a variable, the substitution applies to the whole interval of integration. If you say $t=e^{\frac{-1}{x}}$, you mean that all the values that $x$ takes on are related to the values that $t$ takes by that relation. Really you're applying the function $e^{\frac{-1}{x}}$ to the whole interval of the $x$'s, i.e. $[-1,1]$. Normally, when we do substitution the function you use maps an interval to an interval, so it suffices to just look at the endpoints. Not so with this function! What is the image of $[-1,1]$ under $e^{-\frac1{x}}$? It's $[0,\frac1e]\cup [e,\infty]$, which you can see in a number of ways, e.g. the image of $[-1,1]$ under $1/x$ is $[-\infty,-1]\cup [1,\infty]$, then map it through $e^{-x}$ to get the right interval. Thus the correct substitution ought to be \begin{eqnarray}
&&\int_{-1}^1\frac{e^{-\frac1x}}{x^2(1+e^{-\frac2x})}dx = \int_{[0,\frac1e]\cup [e,\infty]} \frac1{1+t^2} dt = \int_0^{\frac1e} \frac1{1+t^2} + \int_e^\infty \frac1{1+t^2} dt\\ &=& \arctan{\frac1e} - \arctan0 + \arctan{\infty} - \arctan{e} = \arctan\frac1e + \frac\pi2 - \arctan(e) \\&=& \pi-2\arctan(e)
\end{eqnarray}
