Show that $pAp$ is a $C^*$-subalgebra of a $C^*$-algebra $A$. Let $A$ be a $C^*$-algebra and $p \in A$ a projection, i.e. an element satisfying $p=p^* = p^2$. Is it true that $pAp := \{pup: u \in A\}$ is a $C^*$-subalgebra of $A$?
Attempt:
Yes, clearly $pAp$ is a complex subalgebra of $A$ so it suffices to check that $pAp$ is topological closed and adjointly closed.
If $pu_n p \to u$, then $$pu_n p = p^2 u_n p^2 = p(pu_np)p \to pup$$
so by uniqueness of limits $pup = u$ so the limit is also in $pAp$.
Since $(pup)^* = p^* u^* p^* = pu^* p$, it is also adjointly closed.
Is the above correct?
 A: Your approach is correct.
Allow me to say a couple of things about these algebras, which are known as corner algebras.

*

*In fact $pAp$ is the smallest hereditary $C^*$-subalgebra containing $p$. Indeed, suppose $a \in A_{+}$ is such that $0 \leq a \leq pbp$ for some $b$. We will be done if we show that $a \in pAp$. Indeed, from properties of positive elements it follows that
$$
0 \leq (1-p)a(1-p) \leq (1-p)pbp(1-p)=0
$$
Hence, $(1-p)a(1-p)=0$ and therefore $\| a^{1/2}(1-p)\|^2=0$ by the $C^*$-identity. This gives $a(1-p)=0$ and therefore $a=ap$. Hence, taking involution gives $a = pa$. Thus, $a=pap \in pAp$.

*As you correctly pointed out, $pAp$ is closed thanks to the fact that $p$ is an idempotent. For a general $a \in A_+$, the smallest hereditary $C^*$-subalgebra containing $a$ is $\overline{aAa}$. Taking the closure here is necessary  for if $a$ fails to be an idempotent then we can't guarantee that $aAa$ will be closed.

*A useful fact is that if if B is a separable hereditary $C^*$-subalgebra of $A$, then there is $a \in A_+$ such that $B=\overline{aAa}$.

