This following defintion is in my course notes, and proving it is left as an exercise. I have zero clue how to go about proving it. I understand that I will need to use the definition of a composition and the definiton of the natural inclusion, but still, I'm clueless as to how.
Let $f : X → Y$ be a function, and $S ⊂ X$ a subset. Then, there is a function $f|_S : S → Y$ , called the restriction of $f$ to $S$, defined to be $f|_S(s) = f(s)$ for any $s ∈ S$. As an exercise, prove that $f|_S$ is the composition of f with the natural inclusion $i : S → X$.
Any tips (or even a full proof) would be much appreciated. Cheers :)
$i:S\hookrightarrow X$ is defined by $i(s)=s,\,\forall s\in S$.
If $f:X\to Y$, then the restriction $f\restriction _S: S\to Y$ is by definition $f\restriction _S(s)= f(s),\,\forall s\in S$.
Now just note that $f\restriction _S(s)=f(s)=f(i(s))=(f\circ i)(s)$ for each $s\in S$.