Is the function continuous $$f(x)=\begin{cases} x^{2}-1  & x  \leq 1\\x- \frac{1}{x}  & x  \geq 1\end{cases} $$
How can you show if these kind of functions are continuous or not?
 A: For functions with piecewise definitions, there are two things you need to do:


*

*check continuity inside the pieces,

*check continuity at the connections points between the pieces, if any.
In the given case, the first piece is a polynomial so it is continuous everywhere.
The second piece is the sum of a polynomial and the inverse function; the latter is continuous (it is the inverse of a polynomial) except at the root $x=0$, but this value is outside the domain of the piece.
There remains the case of the common bound $x=1$, which causes no difficulty here as the value of the function on both sides is well defined and identical ($0$).
A: Show the right hand limit of the function define for $x\leq1$ is same as the left hand limit of the function defined for $x\geq1$. That is show that
$$\lim_{x\uparrow1}(x^2-1)=\lim_{x\downarrow1}(x-1/x)$$
 both of which are $0$ and hence the function is continuous.
A: For these "piecewise continuous" functions, your intuition is probably that they are continuous if and only if they agree at the "transition points" - this turns out to be true. I'll make a general statement and briefly describe the proof. 
Suppose  $a<c<b$, $g:[a,c] \rightarrow \mathbb R$ and $h:[c,b] \rightarrow \mathbb R$ are continuous, and $f:[a,b] \rightarrow \mathbb{R}$ is defined as follows; $$f(x) = \begin{cases}g(x) & x \in [a,c] \\ h(x) & x\in (c,b]. \end{cases} $$
Then $f$ is continuous at $c$ if and only if $g(c)=h(c)$. 
To prove this; Suppose first $g(c) \neq h(c)$; then if you approach $c$ from the left you get a different value than from the right. To formalise this, take sequences $x_n$ and $y_n$ that approach $c$ from the left and right respectively and show the limits of $f(x_n)$ and $f(y_n)$ are different (this shows more, that you can't define it at $c$ in any way to make it continuous).
Now suppose $g(c) = h(c)$. $g(x)$ is close to $g(c)=f(c)$ when $x$ is close to $c$ from the left. $h(x)$ is close to $h(c) = f(c)$ when $x$ is close to $c$ from the right. Combine this to get that $f(x)$ is close to $f(c)$ when $x$ is close to $c$ from either side; i.e. continuity.
A similar proof strategy also applies when you have say, a function defined with a different value on the rationals and irrationals.
A: Two continuous functions $f:[a,b]\rightarrow\mathbb R$ and $g:[b,c]\rightarrow\mathbb R$ defines a continuous function 
$f\cup g:[a,c]\rightarrow\mathbb R$ if and only if $f(b)=g(b)$.
If $f$ and $g$ are defined on closed intervals and $f\cup g\subset\mathbb R^2$ is a function, then it is a continuous function.
