The problem is not the problem. The problem is your attitude about the problem, Captain Jack Sparrow

Definition. A function f is a rule, relationship, or correspondence that assigns to each element x in a set D, x ∈ D (called the domain) exactly one element y in a set E, y ∈ E (called the codomain or range).
The pair (x, y) is denoted as y = f(x) where: x is the independent variable (input) and y is the dependent variable (output). Often, both the domain D and codomain E are the set of real numbers ℝ or subsets of ℝ.
D is the domain, the set of all possible inputs. E is the codomain or range, the set of all possible outputs.
Key property💡: Each input has exactly one output. (No input is assigned two different outputs — this is the vertical line test!)
Examples: constant, f(x) = c, horizontal line, slope = 0; linear, f(x) = mx + b, straight line, constant slope m and y-intercept b; quadratic $f(x) = ax^2 + bx + c$, u-shaped or inverted U, opens up (a > 0) or down (a < 0), vertex at x = $\frac{-b}{2a}$, symmetry about vertical axis through vertex; polynomial, $f(x) = a_n x^n + \dots + a_0$, a smooth and continuous curve, n roots (counting multiplicity), end behaviour determined by its leading term $a_n x^n$; exponential function, $f(x) = a \cdot b^x, a \ne 0, b \gt 0$, rapid growth (b > 1) or decay (0 < b < 1); trigonometric functions, $\sin(x), \cos(x), \tan (z)$ oscillatory, periodic behavior (period 2π for sin/cos, π for tan), sin and cos are bounded between -1 and 1, but tan is unbounded; step function $f(x) = \lfloor x \rfloor$, greatest integer ≤ x, constant on intervals [n, n+1), jumps at integers, its graph is a staircase shape; absolute value f(x) = |x|, V-shaped graph, slope changes at 0.
Functions can be expressed in multiple forms, each useful in different contexts: verbal description, table of values (list of pairs), algebraic formula, graph, piecewise definition, recursive definition, parametric or integral form, and series representation.
Evaluating a function means finding or computing the output value f(x) for a given input value x. f(x) = $x^2-2x +4, f(2) = 2^2 -2\cdot 2 + 4 = 4 - 4 + 4 = 4, f(0) = 0^2 -2\cdot 0 + 4 = 4, f(1) = 1^2 -2\cdot 1 + 4 = 1 -2 +4 = 3$
The x-intercept is any point on the graph that intersects or crosses the x-axis. In other words, it is the value of x when the function (y-coordinate or y-value) is zero. The y-intercept is the point where the graph intersects or crosses the y-axis. y-coordinate of the point whose x-coordinate is 0, e.g., 2x - 3y = 6. x-intercept: set y = 0 → 2x = 6 ⇒ x=3, so (3, 0). y-intercept: set x = 0 → −3y = 6 ⇒ y = −2, so (0, −2).
f is said to have a local or relative maximum at c if there exists an interval (a, b) containing c ($c \in (a, b)$) such that f(c) ≥ f(x) $∀ x \in (a, b) ∩ D$. f is said to have a local or relative minimum at c if there exists an interval (a, b) containing c ($c \in (a, b)$) such that f(c) ≤ f(x) $∀ x \in (a, b) ∩ D$.💡Local extrema can only occur where the function stops rising or falling —either because the derivative is zero, the derivative doesn't exist, or you're at the edge of the domain.
First Derivative Test. It connects local extrema with changes in the sign of the derivative.
First Derivative Test. Let f be differentiable on an open interval containing c, except possibly at c itself, and let c be a critical point (so f′(c) = 0 or f′ is undefined). Then:
Proof.
Let’s confine ourself to the case of the minimum, the other case is completely analogous.
Assume that f is continuous on an interval containing c, differentiable on that interval except maybe at c. Hence, for some δ > 0: ∀x ∈ (c -δ, c), f’(x) < 0, ∀x ∈ (c, c + δ), f’(x) > 0.
Claim: f(c) is a local minimum, i.e. that for x close to c, f(x) ≥ f(c).
Lagrange’s Mean Value Theorem (LMVT) states that if a function is continuous on a closed interval [a, b] and differentiable on the open interval (a, b), then there exists at least one point $c \in (a, b)$ where the instantaneous rate of change (derivative) equals the average rate of change over the interval, $f'(c)=\frac{f(b)-f(a)}{b-a}$. In other words, the slope of the tangent at c equals the slope of the secant line joining (a, f(a)) and (b, f(b)).
Left side of c. Take any x with $ x\in (c-\delta, c)$. Consider the interval [x, c]. Since f is continuous on [x, c] and differentiable on (x, c), by MVT there exists $\xi \in (x, c)$ such that $f(c) - f(x) = f'(\xi)[c-x] \lt 0$ because c -x > 0 and $\xi \in (x, c) \subset (c-\delta, c) \leadsto f'(\xi) < 0.$ So for x to the left of c, f(x) > f(c).
Right side of c. Now take any $x \in (c, c +\delta)$. Consider the interval [c, x]. Again, MVT gives some $\eta\in (c,x)$ such that $f(x) - f(c) = f'(\eta)[x-c] \gt 0$ because x - c > 0 and $\eta \in (c, x)\subset (c, c + \delta) \leadsto f'(\eta) >0.$ So for x to the right of c, f(x) > f(c) as well.
Combining both sides: for all $x \neq c$ in a small enough neighborhood (sufficient close) to c we have f(x) > f(c). Therefore, f(c) is indeed a local minimum.
The Second Derivative Test is a convenient way to classify critical points algebraically, using information about concavity.
Second Derivative Test. If the first derivate of a function at a point c is zero (f'(c) = 0) and the second derivate at this point exists, then: (i) If f''(c) > 0, then f(c) is a local minimum. (ii) If f''(c) < 0, then f(c) is a local maximum. (iii) If f''(c) = 0, the test is inconclusive.
f′′(c) > 0 ⇒ the graph is concave up near c (like a bowl), so a flat tangent there must be at the bottom → local minimum. f′′(c) < 0 ⇒ concave down near c (like an upside-down bowl), so a flat tangent is at the top → local maximum.
Proof.
Let’s again consider only the local minimum case.
Assume f′(c) = 0, f′′(c) > 0, and f′′ is continuous near c. Since f’’(c) > 0, and f′′ is continuous near c, ∃δ > 0: ∀x ∈ (c - δ, c + δ), f′′(x) > 0.
So, the first derivate f’ is increasing on (c - δ, c + δ). Because f′(c) = 0 and f’ is increasing:
This is exactly the sign change pattern of the First Derivative Test for a local minimum. So f(c) is a local minimum. The case f’’(c) < 0 is analogous and gives a local maximum. If f’’(c) = 0, the second derivative test tells us nothing: the point could be a local extremum, an inflection point, or something more exotic.
Therefore, it has a local minimum at x = 2 and a local maximum at x = -2. The critical point x = 0 is not a local extremum; it’s a point of inflection.
In the previous example (Figure 1), f has local or relative minimum points at -6, -3, and 7, and local or relative maximum points at -5, 0, and 4. On the open interval (0, 4), the function is constant, and therefore every point is both a local or relative maximum and minimum point. Futhermore, (-4, 0), (-2, 0), (0, 6), and (4, 6) are points of inflection.
