Always think of a function as being a conceptual machine that accepts some type of input (specified as its domain) and produces some output. We write "$f : S → T$" to denote that $f$ is a function with domain $S$ such that when you give it any input in $S$ it produces an output in $T$. We write "$f(x)$" to denote the output of $f$ when applied to input $x$.
$
\def\lfrac#1#2{{\large\frac{#1}{#2}}}
$
Now to define a function you must specify both its domain as well as its rule for what input yields what output. For example, we could define a function $g$ with domain $\mathbb{Z}$ such that $g(k) = k^2 - 3·k$ for every $k∈\mathbb{Z}$. Observe that the variable "$k$" here is solely used to define the input-output rule; it does not make any difference if we used any other variable such as "$x$" or "$h$".
Many teachers and textbooks are sloppy in defining functions. For instance, your quoted question from Khan academy appears to define function $f$ by the input-output rule $f(x) = \sin(x)$, but failed to specify its domain, so it is technically an incorrect question. However, we can guess that it wants $f$ to have domain $\mathbb{R}$.
Take any function $f : D → \mathbb{C}$ where $D⊆\mathbb{C}$. We define pointwise differentiability as follows:
Given any $x∈D$, we say that $f$ is differentiable at $x$ iff $\lim_{y→x}^{y∈D} \lfrac{f(y)-f(x)}{y-x}$ exists (in $\mathbb{C}$).
Then we define the derivative of $f$, denoted by "$f'$", as follows:
$\boldsymbol{f'}$ is the function with domain $E = \{ x : \text{$x∈D$ and $f$ is differentiable at $x$} \}$ such that $f'(x) = \lim_{y→x}^{y∈D} \lfrac{f(y)-f(x)}{y-x}$ for every $x∈E$.
Again observe that the variables $x,y,E$" in the above definitions are solely used within the definitions, and we could have substituted them for any three distinct variables.
The whole point is that it is incorrect to say that a function uses an input variable, but it is not your fault because many people teach the concepts wrongly. Rather, you need to use a variable when specifying the input-output rule in defining a function, but that variable is not in any way tied to the function itself. In fact, such variables are called dummy variables, as they only serve to link their occurrences, and do not have meaning outside of the definition.
As to the question in your comments, you have to distinguish between the function and its graph, which unfortunately is another frequent conflation by teachers. Given a function $f : \mathbb{R} → \mathbb{R}$, the graph of $f$ is defined as the set of points $\{ (x,f(x)) : x∈\mathbb{R} \}$, and you can plot the graph of the equation "$y = f(x)$" on the $(x,y)$-plane in the manner you have encountered. You can of course plot the graphs of more than one equation, such as the graph of "$y = f(x)$" and "$y = f'(x)$" on the same $(x,y)$-plane. Note that the choice of variables matters; if you plot the graph of "$x = f(y)$" on the $(x,y)$-plane, you will get a different plot from the graph of $y = f(x)$".