Can you use both sides of an equation to prove equality? For example:

$\color{red}{\text{Show that}}$$$\color{red}{\frac{4\cos(2x)}{1+\cos(2x)}=4-2\sec^2(x)}$$

In high school my maths teacher told me

To prove equality of an equation; you start on one side and manipulate it algebraically until it is equal to the other side.

So starting from the LHS: $$\frac{4\cos(2x)}{1+\cos(2x)}=\frac{4(2\cos^2(x)-1)}{2\cos^2(x)}=\frac{2(2\cos^2(x)-1)}{\cos^2(x)}=\frac{4\cos^2(x)-2}{\cos^2(x)}=4-2\sec^2(x)$$ $\large\fbox{}$
At University, my Maths Analysis teacher tells me

To prove a statement is true, you must not use what you are trying to prove.

So using the same example as before:
LHS = $$\frac{4\cos(2x)}{1+\cos(2x)}=\frac{4(2\cos^2(x)-1)}{2\cos^2(x)}=\frac{2(2\cos^2(x)-1)}{\cos^2(x)}=\frac{2\Big(2\cos^2(x)-\left[\sin^2(x)+\cos^2(x)\right]\Big)}{\cos^2(x)}=\frac{2(\cos^2(x)-\sin^2(x))}{\cos^2(x)}=\bbox[yellow]{2-2\tan^2(x)}$$
RHS =$$4-2\sec^2(x)=4-2(1+\tan^2(x))=\bbox[yellow]{2-2\tan^2(x)}$$
So I have shown that the two sides of the equality in $\color{red}{\rm{red}}$ are equal to the same highlighted expression. But is this a sufficient proof?
Since I used both sides of the equality (which is effectively; using what I was trying to prove) to show that $$\color{red}{\frac{4\cos(2x)}{1+\cos(2x)}=4-2\sec^2(x)}$$
One of the reasons why I am asking this question is because I have a bounty question which is suffering from the exact same issue that this post is about.

EDIT:
Comments and answers below seem to indicate that you can use both sides to prove equality. So does this mean that my high school maths teacher was wrong?
$$\bbox[#AFF]{\text{Suppose we have an identity instead of an equality:}}$$ $$\bbox[#AFF]{\text{Is it possible to manipulate both sides of an identity to prove that the identity holds?}}$$
Thank you.
 A: 
To prove a statement is true, you must not use what you are trying to
  prove.

The main problem is that you've misunderstood what the second teacher said (and possibly the meaning of the equals sign). What that second teacher is saying is do not take as prior facts what you're trying to prove. 
As one textbook puts it (Setek and Gallo, Fundamentals of Mathematics, 10th Edition, Sec. 3.8), "An argument, or proof, consists basically of two parts: the given statements, which are called premises, and the conclusion". Wikipedia says this (sourced from Cupillari, Antonella. The Nuts and Bolts of Proofs. Academic Press, 2001. Page 3.): "In mathematics and logic, a direct proof is a way of showing the truth or falsehood of a given statement by a straightforward combination of established facts, usually axioms, existing lemmas and theorems, without making any further assumptions." 
Now consider a simple equation/identity like $6 = 2 \times 3$. The separate sides are expressions; if you just said "6" in English that's a sentence fragment, not an assertion of any fact. It can't be evaluated as either "true" or "false", because it has no assertive content. It cannot be used as a premise because it's not a proposition. 
What makes something a fully-formed statement in mathematical language is a relation, most commonly equals (but alternatively "is lesser than", "is greater than", etc., effectively the verbs of the language). Translating the equation $6 = 2 \times 3$ to English we get "6 is the same as 2 times 3", which is indeed a full sentence. This can be checked as being true or false; it makes an assertion. It can be used as a premise because it is a proposition of a particular fact.
In conclusion, both your teachers are correct, and both of your proofs are correct (although most of us would prefer the more concise one). When one says "don't use what you're trying to prove" they're not talking about the appearance of any particular expression in an algebraic transformation; expressions are neither premises nor things that can be proven; they are sentence fragments. They're talking about an assertion of fact, which in math has to be a statement including a relational symbol (most commonly an equation). The fact that you didn't start by assuming that equality means that in both cases you've complied with your second teacher's warning. 
A: short answer: equality is symmetric, implication is not (both are however transitive)
longer answer:

*

*You are right: if you prove $A = C$ and $B = C$ for some terms/expressions/objects $A,B,C$ then you are allowed to conclude that $A = B$ (because "=" is transitive and symmetric)


*Your teacher is right: if you prove that something true follows from $A = B$, i.e. $A = B \implies \text{true}$, you are not allowed to conclude the converse i.e. that $A = B$ since "true is true" (because implication is not symmetric)
A: Unfortunately your high-school teacher (and some of the other answers) is wrong. It is false that proving something of the form "$A = B$" is always possible by starting from one side and algebraically manipulating it to get a sequence of equal expressions ending with the other side, not to say necessary.
Not necessary
Let us first deal with the false misconception that you can only go in one direction. Suppose you have proven the following, where $A,B,C$ are any expressions:
  $A = C$.
  $B = C$.
Then you can use the second sentence to substitute $C$ for $B$ in the first to obtain:
  $A = B$.
This is logically valid because "$=$" means "is exactly the same as".
Not always possible
Let us now consider an example where it is simply impossible to manipulate from one side to the other to prove an equality!
$\def\zz{\mathbb{Z}}$
$\def\qq{\mathbb{Q}}$
$\def\rr{\mathbb{R}}$
Theorem:
  Take any $x \in \rr$ such that $x^2 \le 0$. Then $x = 0$.
Proof:
  $x = 0$ or $x > 0$ or $x < 0$.   [by trichotomy]
  If $x > 0$:
    $x^2 = x \times x > 0$.   [by positive multiplication]
    This contradicts $x^2 \le 0$.
  If $x < 0$:
    $0 < -x$.   [by subtraction]
    $x^2 = (-x) \times (-x) > 0$.   [by positive multiplication]
    This contradicts $x^2 \le 0$.
  Therefore $x = 0$.
Here "positive multiplication" denotes "multiplying by a positive real", which preserves the inequality sign. Similarly subtraction preserves an inequality. The above theorem cannot be proven directly by algebraic manipulation from one side "$x$" to the other "$0$", simply because the only given condition is an inequality.
Similarly the construction of $\sqrt{2}$ in elementary real analysis, as shown below, does not permit a proof by algebraic manipulation.
Theorem:
  Let $S = \{ r : r \in \qq_{\ge 0} \land r^2 \le 2 \}$.
  Then $S$ is non-empty and has an upper bound in $\rr$.
  Let $x = \sup_\rr(S)$.
  Then $x^2 = 2$.
Proof:
  [Exercise! Or see a good textbook like Spivak's.]
General identities
To address the new sub-question in blue, it suffices to generalize the above theorem to the cube-root of arbitrary real numbers, namely:

$\sup( \{ r : r \in \qq \land r^3 \le x \} )^3 = x$ for any $x \in \rr$.

This is an identity but cannot be proven by direct manipulation. You may not be satisfied with this counter-example, but in higher mathematics this kind of identity is in fact the usual kind that we are interested in, rather than identities that can be proven by algebraic manipulation (which are usually considered trivial). Here are some more examples:

$\lceil \frac{m}{n} \rceil = \lfloor \frac{m-1}{n}+1 \rfloor$ for any $m \in \zz$ and $n \in \zz_{>0}$.
$\sum_{k=0}^{n-1} 2^k = 2^n-1$ for any $n \in \zz_{>0}$.

Nevertheless, if you desire an arithmetic identity, the question becomes much more interesting and depends heavily on what you mean by "arithmetic" and what axioms you are allowed to use. Tarski's problem asked whether an arithmetic identity concerning positive integers can be proven using only the basic high-school identities about them, and Wilkie gave an explicit and simple identity that cannot be so proven, basically because any proof needs to use subtraction and hence negative integers.
A: There's no conflict between your high school teacher's advice

To prove equality of an equation; you start on one side and manipulate it algebraically until it is equal to the other side.

and your professor's

To prove a statement is true, you must not use what you are trying to prove.

As in Siddarth Venu's answer, if you prove $a = c$ and $b = c$ ("working from both sides"), then $a = c = b$ by transitivity of equality. This conforms to both your teacher's and professor's advice.

Both your high school teacher and university professor are steering you away from "two-column proofs" of the type:
\begin{align*}
-1 &= 1 &&\text{To be shown;} \\
(-1)^{2} &= (1)^{2} && \text{Square both sides;} \\
1 &= 1 && \text{True statement. Therefore $-1 = 1$.}
\end{align*}
Here, you assume what you want to prove, deduce a true statement, and assert that the original assumption was true. This is bad logic for at least two glaring reasons:


*

*If you assume $-1 = 1$, there's no need to prove $-1 = 1$.

*Logically, if $P$ denotes the statement "$-1 = 1$" and $Q$ denotes "$1 = 1$", the preceding argument shows "$P$ implies $Q$ and $Q$ is true", which does not eliminate the possibility "$P$ is false".
What you can do logically is start ("provisionally", on scratch paper) with the statement $P$ you're trying to prove and perform logically reversible operations on both sides until you reach a true statement $Q$. A proof can then be constructed by starting from $Q$ and working backward until you reach $P$. Often times, the backward argument can be formulated as a sequence of equalities, conforming to your teacher's advice. (Note that in the initial phase of seeking a proof, you aren't bound by anything: You can make inspired guesses, additional assumptions, and the like. Only when you write up a final proof must you be careful to assume no more than is given, and to make logically-valid deductions.)
A: I agree with @Siddharth Venu.
If we have to prove a=b,
At times, on proceeding from LHS you may end up in a stage(intermediate step) which you cannot solve any further and you continue to solve RHS to arrive at the same stage 
i.e, a=c and b=c so you can conclude that a=b these kind of equality problems often comes in trigonometry
Many chapters like matrices and our normal algaebra always have a final step where you can directly establish a relation (a=b).   
A: There are two common errors that these methods are preventing:  \begin{align}
    1 &< 2  &&\text{True.}  \\
    0 \cdot 1 &< 0 \cdot 2  &&\text{Um...}  \\
    0 &< 0  &&\text{False.}
\end{align}
\begin{align}
    1 &= 2  &&\text{False.}  \\
    0 \cdot 1 &= 0 \cdot 2  &&\text{Um...}  \\
    0 &= 0  &&\text{True.}
\end{align}
Much confusion ensues when the two "$0$"s in the middle steps are obscured by being large, complicated expressions.  For instance, is it evident that you are multiplying by zero when you multiply by $\sin(2x) - 2\sin(x)\cos(x)$?  (This uses the double angle formula for sine to get an expression that is always zero.)  The correct form of inference when you multiply or divide by something complicated is "$A = B$" becomes "$A/C = B/C$ or $C = 0$".  That is, you got what you expected or you have inadvertently done something crazy.  It seems to take a lot of practice to remember that second clause.
The example with $A$, $B$, and $C$ can be altered somewhat without changing the need for the second clause.  You can also multiply both sides by $C$.  The relation need not be an equality.  Note however, that the sense of an inequality may change if $C$ is ever negative.
A: It is enough.. Consider this example:
To prove:
$a=b$
Proof:
$$a=c$$
$$b=c$$
Since $a$ and $b$ are equal to the same thing, $a=b$.
That is the exact technique you are using and it sure can be used.
