The problem above is from Khan Academy. The correct answer is "C" and I know how to get it. This is what I have trouble with:
Whenever I see a function and its derivative, both the function and its derivative use the same input variable. For example $f(x)$ and $f'(x)$ both use $x$. In the Khan Academy problem, the function is called $f(x)$ so the derivative should be called $f'(x)$. But, since the answer is C, it is impossible for the derivative to be called $f'(x)$ because $f'(\frac{\pi}{2})=\lim_{x\to \frac{\pi}{2}}\frac{sin(x)-sin(\frac{\pi}{2})}{x-\frac{\pi}{2}}$. In other words, you can only write the derivative as $f'($any variable other than $x)$. So, if the function and its derivative in this problem have different input variables, how can you graph them on the same coordinate plane? I think this issue has more to do with how to graph stuff than calculus.

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:
Then we define the derivative of $f$, denoted by "$f'$", as follows:
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)$".