I am reading a book about functional equations and I was faced by this problem. I am really struggling to understand the proof/solution and would like some help. The problem is as follows
Draw the graph of the function $f: \Bbb R \rightarrow \Bbb R$ if it satisfies the following two conditions:
(a)$f(x+1)=f(x)-2, \forall x \in \Bbb N$
(b)$f(x)=x^2, x \in [0,1)$
Solution:
Using induction it is easy to see that $$f(x+n)=f(x)-2n, \forall n \in \Bbb N$$
Let $y \in \Bbb R $ be an arbitary real number. We can always write $y=x+n$, where $n$ is the integer part [y] of $y$ and $x$ is the fractional part $\{y\}$ of $y$.
Then the previous equation gives $$f(y)=f(\{y\})-2n, n \le y \le n+1$$
Since the fractional part satisfies the inequality $0 \le \{y\} \le 1$ and $f(\{y\}) = \{y\}^2$ from (b). However, $\{y\} = y -n$ and we finally have $$f(y)=(y-n)^2 - 2n, n \le y \le n+1$$
The graph of the function looks as follows:

My questions may be too long but any help would be appreciated even if only parts of the questions are answered :
1) How can $f(x+n)=f(x)-2n, \forall n \in \Bbb N$ be proved by induction (I have never tried inducting on functional equations and would like to see how it works).
2) When solving such a problem how could such an assumption be made?
3) I do understand all the steps, which consisted of simple substitution, but why didd we comeup with such a number y, and what is its significance?
4) How was the final equation plotted? (My most important question).
Thanks and feel free to edit the tags, adding what you feel is more appropriate.
I prefer to do part (4) first.
(4) The graph could be drawn from any of the given equations. It might even be more intuitive (and helpful in solving the rest of the problem) to draw the graph from the very first definition of $f$: \begin{align} f(x)&=x^2 &&\quad \text{if}\quad 0 \leq x < 1 \tag{1b}\\ f(x+1)&=f(x)-2 &&\quad \text{if}\quad x \in \mathbb R \tag{1a} \end{align} (Yes, I wrote part (b) before part (a). I did that because as it happens, this is an inductive definition of $f$; because in this inductive definition, part (b) is the base case; and because in induction we typically like to write the base case before we write the inductive step.)
From Equation ($1$b), we can immediately draw the part of the graph that consists of the curve from $(0,0)$ to $(1,1)$ (including the point $(0,0)$ itself but not the point $(1,1)$, hence the "open" circle at $(1,1)$).
To jump to an arbitrary place in the graph may not be obvious, but we can very easily follow up with the part of the graph for $1 \leq x < 2$, since this is just the graph of $f(x+1)$ for $0 \leq x < 1$ and we can easily see by combining Equations ($1$a) and ($1$b) that $$ f(x+1) = f(x)-2 = x^2 - 2 \quad \text{if}\quad 0 \leq x < 1. \tag{1c} $$ A change of variables, $u = x+1$, gives us $$ f(u) = f(u-1)-2 = (u-1)^2 - 2 \quad \text{if}\quad 1 \leq u < 2 $$ which we can easily plot from $(1,-2)$ to $(2,-1)$, or we can look at Equation ($1$c) and conclude that if we apply that equation to "all" the values of $x$ such that $0 \leq x < 1$, the equation $f(x+1) = x^2 - 2$ copies all the points we plotted between $(0,0)$ and $(1,1)$, but $2$ units down in the $y$ direction and $1$ unit to the right in the $x$ direction.
But now that we have plotted $f(x)$ for $1 \leq x < 2$, we can use Equation ($1$a) again to copy the curve from $(1,-2)$ to $(2,-1)$ to a new part of the graph, $2$ units down and $1$ unit to the right. And again and again, until we run out of paper in the lower right corner.
Now we might guess that the pattern we see going down to the right also goes up to the left, and indeed it does, because the change of variables $u = x+1$ in Equation ($1$a) gives us $$ f(u)=f(u-1)-2 \quad \text{if}\quad u \in \mathbb R $$ (noting that $u - 1 \in \mathbb R$ is the exact same condition as $u \in \mathbb R$), from which we can conclude that $$ f(u-1)=f(u)+2 \quad \text{if}\quad u \in \mathbb R. $$ So we proceed as before, except this time $u-1$ takes us $1$ unit to the left and $f(u)+2$ takes us $2$ units up.
In short, the statement that $f(x) = x^2$ if $0 \leq x < 1$ lets us draw one part of the graph (the base case), and the statement that $f(x+1)=f(x)-2$ lets us copy one part of the graph to another (the inductive step) as many times as we like to make the pieces of the graph for $n\leq x < n+1$ for integer $n$ as large as we like.
The base case plus the inductive step make an inductive definition.
Drawing the graph from one of the other equations, we have to recognize that the curve we get between $x=0$ and $x=1$ doesn't continue between $x=1$ and $x=2$, that the curve we get between $x=1$ and $x=2$ doesn't continue between $x=2$ and $x=3$, and so forth, so that we get a different piece of the graph in each of those intervals of $x$, each piece disconnected from the pieces before and after it. This could become very tedious, or we could intuitively see the inductive pattern and then it could become easy.
(1) The obvious intuition from the graph is that if we take $n$ unit steps to the right we take $2n$ unit steps down. From this we can guess that $\forall n \in \mathbb N : f(x+n)=f(x)-2n$. To prove that fact,
(2) If you recognize the fact that the definition of the function is inductive, then the obvious question is, "What happens if I apply the inductive step $n$ times?" The answer to that question is that you get a formula for $f(x+n)$, indeed it's the formula in part (2).
(3) Looking at the graph again, which consists of a sequence of disconnected parabolic arcs, it should be clear that in order to find $f(x)$ for any value of $x \in \mathbb R$, we can first determine which of the parabolic arcs $x$ will fall upon, and how far up the arc the point $(x,f(x))$ will be. It should also be clear that the arc is uniquely identified by its left-hand starting point, that the $x$ coordinate at that point is an integer, and that the integer part of that $x$ coordinate is the same for all the points along one arc. "How far up the arc" any point $(x,f(x))$ is is determined just by how much we have to add to the integer part of $x$ to get to $x$ itself; that is, the position on the arc is determined by the fractional part of $x$.
So if the integer part of $x$ and the fractional part of $x$ are both needed to find $f(x)$, and if they play such different roles in finding $f(x)$, it makes sense to rewrite $x$ in terms of its integer part and its fractional part. But the solution decided to make a change of variable names in addition to rewriting the variable as a sum of an integer part and a fractional part, so we write $y$ instead of $x$, and then the symbol $x$ is available to represent $\{y\}$, the fractional part of $y$.
It turns out that redefining $x$ in this way is unnecessary, since that meaning of $x$ never gets mentioned explicitly again. The important thing is that we look at the formula $f(x+n)$ from part (1) and see how useful it would be to replace the $x$ with the fractional part of a number and the $n$ with the integer part of the same number.