How to show orthogonality with respect to the Euclidean inner product involving a curve in $\mathbb{R}^n$ and a point not on the curve Specifically, the question is as follows:

Let $f: \mathbb{R} \rightarrow \mathbb{R}^n$ be a differentiable mapping (a curve) with
  $f^\prime(t) \ne 0$ for all $t \in \mathbb{R}$. Let $p$ be a fixed point not on the image $f$. If $q = f(t_0)$ is the point of the curve closest to $p$,
  that is $| p - q| \le |p - f(t)|$ for all $t \in \mathbb{R}$,
  show that the vector $(p - q)$ is orthogonal to the curve
  at $q$. Here the orthogonality is with respect to the usual Euclidean inner product. 

I've also been given the following hint: 

Differentiate the function
  $\varphi(t) = | p - f(t)|^2$.

I understand that $p$ and $q$ are points in $\mathbb{R}^n$ and that $(p-q)$ is the vector that is between $p$ and $q$. I also understand that to show $(p - q)$ is orthogonal to the curve
at $q$, I need to show that $\langle(p-q),f'(q)\rangle=0$, as orthogonality to the curve at a point is given by a $0$ inner product with the tangent to the curve at the point. My confusion lies in understanding what $\varphi(t)$ and it's derivative represent, as well as how to use them.
Correct me if I'm wrong, but it seems like $\varphi(t)$ is a parabaloid (or some step function eqivalent if $f$ is discontinuous) where the vertex is the minimum value, $|p-q|$ (i.e. when $t=t_0$). So what information do I acquire from taking the derivative that I can utilize to solve this problem?
In a more direct sense, I know that I want to show that $\langle(p-q),f'(q)\rangle=0$, so, equivalently, I want to show that $\sum_{i=1}^n(p_i-q_i)q_i=0$. Expanding and differentiating, I have that $\varphi'(t)=2\sum_{i=1}^nf'(t)_i(f(t)_i-p_i)$. But I don't see what to do from here.
I'd like assistance in interpreting this problem (ideally geometrically and algebraically) so that I can develop a solution. This is homework, so I request guidance only.
 A: $\varphi(t)$ is the square if the distance from the point to the curve $f$. You know that $q=f(t_0)$ minimizes the distance to $p$. Then $\varphi'(t_0)=0$. On the other hand $$\varphi'(t)=2\langle \alpha(t)-p,\alpha'(t)\rangle .$$
So hence
$$\varphi '(t_0)= 2\langle \alpha(t_0)-p ,\alpha'(t_0)\rangle=2\langle q-p,\alpha'(t_0)\rangle =0, $$
showing the desired result.
A: OK, so I take it as well understood that the distance 'twixt any two points $u, v \in \Bbb R^n$ is $\vert u - v \vert$, where for any $z \in \Bbb R^n$
$\vert z \vert^2 = \langle z, z \rangle, \tag 1$
where $\langle x, y \rangle$ is the standard Euclidean inner product on $\Bbb R^n$; that is, with
$x = (x_1, x_2, \ldots, x_n), \; y = (y_1, y_2, \ldots, y_n), \; x_i, y_i \in \Bbb R, \; 1 \le i \le n, \tag 2$
we have
$\langle x, y \rangle = \displaystyle \sum_1^n x_i y_i; \tag 3$ 
with
$u = (u_1, u_2, \ldots, u_n), \; v = (v_1, v_2, \ldots v_n), \tag 4$
we thus find in accord with (3) that
$\vert u - v \vert^2 = \langle u - v, u - v \rangle = \displaystyle \sum_1^n (u_i - v_i)^2, \tag 5$
which is of course a familiar generalization of the Pythagorean Theorem to $\Bbb R^n$.
From the above considerations we see that the squared distance between any point on our curve $f(t)$ and $p$ is
$\phi(t) = \vert f(t) - p \vert^2 = \langle f(t) - p, f(t) - p \rangle, \tag 6$
and since taking the square is a strictly monotonically increasing function $\Bbb R_{\ge 0} \to \Bbb R_{\ge 0}$, finding a minimum of $\vert f(t) - p \vert^2$ is equivalent to finding minima of $\vert f(t) - p \vert$, and the calculations are a little easier, so . . . 
Evidently then the extrema of $\phi(t) = \vert f(t) - p \vert^2$ occur at those $t$ for which
$\phi'(t) = (\vert f(t) - p \vert^2)' = \langle f(t) - p, f(t) - p \rangle' = 0; \tag 7$
now if we momentarily assume $x$ and $y$ are functions of $t$ in (3), we may write
$\langle x(t), y(t) \rangle  = \displaystyle \sum_1^n x_i(t) y_i(t), \tag 8$
whence
$\langle x(t), y(t) \rangle' = \displaystyle \sum_1^n x_i'(t) y_i(t) + \sum_1^n x_i(t) y_i'(t) = \langle x'(t), y(t) \rangle + \langle x(t), y'(t) \rangle, \tag 9$
which applied to (7) gives
$\phi'(t) = \langle f(t) - p, f(t) - p \rangle' = \langle f'(t), f(t) - p \rangle + \langle f(t) - p, f'(t) \rangle = 2\langle f'(t), f(t) - p \rangle; \tag{10}$
therefore,
$\langle f'(t), f(t) - p \rangle = 0, \tag{11}$
i.e., the tangent vector $f'(t)$ to $f(t)$ is normal to $f(t) - p$ for those $t$ at which the squared distance $\vert f(t) - p \vert^2$, hence the distance $\vert f(t) - p \vert$, is extremal.  This of course means that $f(t) - p$ is orthogonal to the curve $f(t)$ at a point $q$ on $f(t)$ with
$\vert q - p \vert \le \vert f(t) - p \vert, \; \forall t \in \Bbb R, \tag{12}$
since $q$ is a local minimum of $\vert f(t) - p \vert^2$.
In closing, I address a couple of our OP's further concerns:
We can't really say $\phi(t) = f(t) - p$ is a paraboloid, since we don't know the functional form of $f(t)$; but is certainly makes at least some sense to say that $\vert \phi(t) \vert^2 = \vert f(t) - p \vert^2$ has characteristics similar in some ways to a parabola; after all $\vert \phi(t) \vert^2$ is a quadratic--sort of a "parabolic" function of $\vert f(t) - p \vert$.
Finally, we needn't consider the case of discontinuous $f(t)$, since $f(t)$ being differentiable is indeed itself continuous as well.
