I apologise as I know I'll probably get a lot of criticism here but I desperately need help as I've no idea how math functions work! I've looked through books, youtube videos, asked my tutor... but nowhere can I find an example that breaks down each component and what it is actually doing. It seems (from my perspective) that numbers (and answers!) are plucked from thin air.
Example A, $f: \mathbb{Z} \to \mathbb{Z}$ given by $f(m,n) = m + n + 1$.
Example B: $f: \mathbb{R} \to \mathbb{R}$ given by $f(x)=(x+1)(x+2)$.
This just looks like hieroglyphics to me. I don't get it at all! I'm supposed to determine onto/1-1 but how do I know what numbers to put into the domain vs codomain? How do I know if the numbers in domain "relate" to numbers in codomain? What is showing the relation?
Here is what I wrote to try to solve example B so you can see I have no idea what I'm doing...
$Y=f(x), y=(x+1)/(x+2) x=x-2overx-1$??? Domain $1,2,3...$ (domain of inf real numbers?) Codomain: if $x=1$ then $(1-2)/1-1)$** cannot divide by zero
If $x=2$ then $(2-2)/(2-1)=0$
If $x=3$ then $(3-2)/(3-1)=\frac{1}{2}$ Etc **I reverse it??
My understanding is I pluck a number from the sky that becomes $x$ and then do "some calculation" to get the co-domain (probably wrong). And how would I know whether they "match"???
And example A has two numbers as $x$ so wth is with that?!
I know I'm rambling but I really need someone to break the parts down for me so I can finally do these! If you can help I'd be very grateful. Thank you!
I will try to explain how I see a function.
A function is a tool, a tool that transforms what we call a vector ( usually name $x$ ) into another vector. I guess you have been working with function that are defined on $\mathbb{R}$ and that gives for a vector $x \in \mathbb{R}$ another number that you called $y \in \mathbb{R}$. We usually note $f : \mathbb{R} \rightarrow \mathbb{R}$. A function $f : \mathbb{R} \rightarrow \mathbb{R}$ transforms a point to another point. That's why you draw the abscisse $Ox$ that is the real line where $x$ takes it value and then you drax the axis $y$ which will be the value of $f(x)$. Then each point $(x,f(x))$ is colored black and the rest in black, you have the graph of the function. The unique function that transforms a given point to the same point is called the identity and it is trivially defined as $f : x \mapsto x$.
What it means is for a number for example $4$, you will by $f$ another number maybe $6$ maybe $\pi$ it depends on the function you are considering. Such a function exists on a domain $D$ if the image of an element $x \in D$ actually exists. Most problems comes from fractional function where you have to check that the dominator does not equal to $0$. For example $\displaystyle x \mapsto \frac{1}{x}$ will be defined (almost) everywhere, $1/\text{something}$ does not bother except if this something is $0$. Hence it is defined on $\mathbb{R}^{*}$. For your example $B$. $$ f : x \mapsto \frac{x+1}{x+2} $$ All reals are will be defined unless the dominator $x+2$ equals to $0$ because it will tends to $+\infty$ and not take a finite value. So it is defined on $\mathbb{R}$ minus $-2$.
A more original way to consider a function is to see it as a " deformation " of the graph $y=x$.
We've seen that a function can transform a real to another real. Your example A is not this type of function. It transforms a point of a plan to a real number. For example the origin of the plan $P$ axed with $\left(O,x,y\right)$ will be given the value $1$. Imagine it is gridded. Then every point on the grid situated on the diagonal who goes through $(0,0)$ will be given the value $2n+1$, depending on how far you are on this diagonal.