Remainder Theorem: $f(x) = x^3+1$ divided by $\operatorname {d}(x)= x$ Take for example $\operatorname {f}(x) = x^3+1$ divided by $\operatorname {d}(x)= x-1$ $$\frac {x^3+1}{x-1}$$
The Remainder Theorem tells us that the remainder will be $$\operatorname {f}(zero-of-\operatorname {d}(x))$$
In this case the remainder should be $$\operatorname {f}(1) = 1^3+1 = 2$$
so the remainder should be 2 for any value of $x$  
But for $x=3$
$$f(3) = 3^3+1$$
when this is divided by $x-1$ which is $3-1$ which equals to $2$, $$\frac {3^3+1}{3-1}$$ $$= \frac {27+1}{2}$$ $$= \frac {28}{2}$$ $$= 14, remainder = 0 ≠ 2$$
Please explain me why this happened
 A: There is a distinction between the statements :

The division of the polynomial $f(x)$ by the polynomial $x-a$, yields the remainder as the constant polynomial $f(a)$.

and

For each $y$, if we divide the number $f(y)$ by the number $y-a$, the remainder is always $f(a)$.

The difference is simple : one refers to polynomial division, the other to integer division. You seem to think that these statements are both implied by one another. The second, is in fact NOT TRUE.

Why? Well, note that $f(y) - f(a)$ is always a multiple of $y-a$, so what is true is this :

For each $y$, the numbers $f(y)$ and $f(a)$ leave the same remainder when divided by $y-a$.

Now, what if $f(a) \geq y-a$? Then it cannot be a possible remainder when something is divided by $y-a$.
That's what is happening in your example : you have $f(1) = 2$, and $y=3$ so $y-a = 2$ as well. So if you divide $f(3)$ by $2$, you get $0$ as the remainder, which is the same as when you divide $f(1)$ by $2$. But $f(1)$ itself can't be the remainder because the remainder upon division by $2$ can only be $1$ or $0$, which $f(1)$ is not.

Basically, if you want to find the remainder when $f(y)$ is divided by $y-a$, the answer is NOT $f(a)$ , but rather the remainder when $f(a)$ is divided by $y-a$. That number in your case is $2 \pmod 2 = 0$.
A: Leave fractions aside. The remainder theorem tells you that, if $f(x)$ is a polynomial with integer coefficients and $a$ is an integer, then
$$
f(x)=(x-a)q(x)+f(a)
$$
so $f(a)$ is the remainder of the division by $x-a$ in the ring of polynomials with integer coefficients.
What you're conjecturing is that $f(a)$ should also be the remainder of the division of $f(b)$ by $b-a$, whenever $b$ is an integer.
This is not possible, in general. For instance, if $b=a+1$, then would you expect that $f(a)$ is the remainder of the division of $f(a+1)$ by $(a+1)-a=1$? Well, no! The remainder in this case is zero, whatever $f(a+1)$ is.
And what if $f(a)<0$?
Example, similar to yours but with $f(x)=x^3-1$ and $a=-1$: we have $f(-1)=-2$ and indeed
$$
x^3-1=(x+1)(x^2-x+1)-2
$$
With the standard definitions, $-2$ can never be a remainder.
What you can say, and no more, is that
$$
f(b)=(b-a)q(b)+f(a)
$$
and therefore $f(a)\equiv f(b)\pmod{b-a}$
A: Evaluating the polynomial remainder theorem at $\,x =\,$ some number does yield a valid congruence but the result may not be the canonical remainder because leastness need not be preserved. Let's see how the proof actually $\rm\color{#c00}{breaks \ down}$ after evaluation at $\,x = b$.
$\begin{align}
f(x) = (x\!-\!a)q(x) + f(a) &\Rightarrow f(x)\equiv  f(a)\!\!\!\pmod{\!x\!-\!a} \Rightarrow f(x)\,\bmod x\!-\!a = f(a)\\[.3em]
{\rm so}\ \,f(b) =\, (b\!-\!a)\,q(b) + f(a) &\Rightarrow f(b)\equiv  f(a)\!\!\pmod{\!b\!-\!a} \,\color{#c00}{\not\Rightarrow}f(b)\ \,\bmod b\!-\!a = f(a)\\[.3em]       
{\rm e.g.}\,\
x^3\!+\!1 = (x\!-\!1)q(x) + 2 &\Rightarrow x^3\!+\!1\,\equiv\,  2\!\pmod{\!x\!-\!1} \Rightarrow x^3\!+\!1\bmod x\!-\!1 = 2\\[.3em]
{\rm so}\ \ \ \ \ 3^3\!+\!1 =\:\! (3\!-\!1)q(3) + 2 &\Rightarrow\, 3^3\!+\!1\,\equiv  \,2\!\pmod{\!3\!-\!1} \color{#c00}{\not\Rightarrow} 3^3\!+\!1\bmod\, 3\!-\!1 = 2\\
\end{align}$
Obviously we can remedy this by doing a $\rm\color{#0a0}{final}$ modular reduction to ensure we obtain the least number congruent to $\,f(b),\,$ i.e. the remainder, e.g. above  $\,3^3\!+\!1\bmod 2 = 2\color{#0a0}{\bmod 2} = 0,\,$ and $\,f(a)\bmod b\!-\!a = f(b)\color{#0a0}{\bmod b\!-\!a}.\,$ This is simply the remainder form of the congruence  $\,f(a)\equiv f(b)\pmod{ b\!-\!a}.\,$  The inference is done more naturally in congruence language:
$\!\bmod b\!-\!a\!:\,\ a\equiv b\Rightarrow f(a)\equiv f(b)\,$ for any polynomial $f(x)$ with integer coef's, by the Polynomial Congruence Rule.
A: $$\frac{x^3+1}{x-1}=x^2+x+1+\frac{2}{x-1}$$
Here $f(x)=x^3+1$, so the remainder when $f(x)$ is divided by the linear factor $x-1$ is a constant 2 as seen above and which is nothing but $f(1)=2$.
If the divisor is quadratic, the remainder is linear function of $x$ or a constant.
