Creating a question that use the $\epsilon$-$\delta$ definition to prove that $f$ is a continuous function Let $f:\Bbb R\backslash \{1 \} \to \Bbb R$ be defined by $f(x)= \frac{1}{(1-x)}$. Use the $\epsilon$-$\delta$ definition to prove that $f$ is a continuous function. 
I do not need answers for it. I want your help to twist the questions a little bit with the goal to get another set of questions with more difficulty or similar difficulty and requires different tricks to solve the questions. Please provide the answers and explanation too.
 A: The general case for polynomials isn't hard to understand, just cumbersome to write. I'll do the sketch of a particular example here, with the full explanation.


*

*For all $a \in \Bbb R$: $$\lim_{x \to a} x^3 + 3x^2 - 5x + 1 = a^3 + 3a^2 - 5a + 1 $$


Sketch: we want to find $\epsilon$ such that the difference between the polynomial and the limit is less than $\epsilon$. If indeed the limit is right, $|x - a|$ always will be a factor of the difference. Let's find out here what we must impose on $\delta$ to get what we need. We have: $$\begin{align} |x^3 + 3x^2 - 5x + 1 - (a^3 + 3a^2 - 5a + 1)| &= |x^3 - a^3 + 3(x^2 - a^2) -5(x - a)| \\ &= |(x - a)(x^2 + ax + a^2) + 3(x-a)(x+a) - 5(x-a)| \\ &= |(x^2 + ax + a^2) + 3(x+a) - 5||x - a| \end{align}$$
Now, stop and think. I need to bound the stuff that multiplies $|x - a|$. What inequalities do I know? Well, there's always the triangle inequality, so, why not? $$ \leq \left(|(x^2 + ax+ a^2)| + |3(x + a)| + |-5| \right)|x - a|$$
Seems a little better. But why not do it again? $$\leq \left( |x^2| + |a||x| + a^2 + 3|x| + 3|a| + 5 \right)|x-a|$$
Now, there is an issue. I just can't have $\delta$ depending on $x$. It is varying! But, if I could bound $|x|$ somehow, my problem would be done! Yet, there is another inequality that is useful, and everyone should have it at hand: $$|x| - |a| \leq |x - a| < \delta $$
which readily implies that $|x| < \delta + |a|$. Well, certainly I could suppose that $\delta$ is, let's say, less than $1$. Why is that? Given $\epsilon > 0$, I must find $\delta = \delta(\epsilon, a) > 0$ such that yadda yadda yadda (put the definition of the limit here). My point is: every other $\tilde{\delta} < \delta$ will also work! So, suppose $\delta < 1$. This gives $|x| < 1 + |a|$. Going back to our chain of inequalities, we obtain: $$\begin{align} &\leq \left( (1 + |a|)^2 + |a|(1 + |a|) + a^2 + 3(1+|a|) + 3|a| + 5 \right) |x - a| \\ &= \left(8 + 9|a| + 3a^2 \right) |x - a| \\ &\leq (8 + 9|a| + 3a^2) \cdot \delta \end{align}$$
Now, no matter how ugly it is, $8 + 9|a| + 3a^2$ is just a fixed number! Notice that all of those expression will be quite simple, once given a value for $a$. Now, what should  $\delta$ be, if I wanted to give one more step? $$(8+ 9|a| + 3a^2) \cdot \delta < \epsilon$$
Certainly $\delta < \frac{\epsilon }{8 + 9|a| + 3a^2}$ will do the job! However, we must heed some care here. What else have we supposed on our way to get here? That $\delta < 1$ also, no? If I want everything to hold, I must choose: $$\delta <\min \bigg\{1, \frac{\epsilon}{8 + 9|a| + 3a^2} \bigg\} $$
And we should never forget, a more formal proof would begin with:

Let $\epsilon > 0$, and $x \in \Bbb R$ such that $|x - a| < \delta $. Choose $\delta \leq \min \big\{ 1, \frac {\epsilon}{8 + 9|a| + 3a^2} \big\}$. Then we have $$| \cdots - \cdots| \leq \cdots \leq \cdots \leq \cdots \leq \epsilon $$

Here, these $\cdots$ are just the inequalities I did on the sketch. 

An observation that I deem important: what if we had more than one factor $|x - a|$? Should we bound all of them with $\delta $? My answer to that is a definite no. We certainly don't want to work with $\sqrt{\epsilon}, \sqrt[5]{\epsilon}$, and stuff like that. You bound only one of the factors $|x - a|$ with $\delta$, and the other ones you deal with using the triangle inequality + $|x| < 1 + |a|$ combo. Example:


*

*Prove that $\lim_{x \to 1} x^2 - 2x + 1 = 0$ using the $\epsilon - \delta$ definition. 


Sketch: we have $|x - 1| < \delta$, and we want $|x^2 - 2x + 1| < \epsilon$. Suppose $\delta < 1 $. This way, $|x| < \delta + 1 < 2$. Finally: $$\begin{align} |x^2 - 2x + 1| &= |(x-1)^2| \\ &= |x - 1||x - 1| \\ &\leq (|x| + 1) \cdot \delta \\ &\leq 3 \delta \end{align}$$
So $\delta <\min \big\{ 1, \frac{\epsilon}{3} \big\}$ is the solution to this problem. 

This strategy works beautifully for polynomials in several variables. The only issue is that the calculations become insane, the probability of making an arithmetic mistake is just too damn high, which makes almost inviable to put this in action. Fortunately we have theorems for continuity saving our lives here. The idea would be the same, limiting all the variables one by one, as in: $$|x_1| < \delta + |a_1| \\ |x_2| < \delta + |a_2| \\ {}{}{}\vdots \\ |x_n| < \delta + |a_n| $$

Just to end my answer here, I'll leave my opinion... these kinds of exercises, although easily generalised, are something every student should do at least once in his/her life, to get used to this type of inequality manipulation. I think this question should have received more attention, and if I find/remember other limits that I feel comfortable enough to explain, maybe I'll come back and update this answer.
Cheers.
