You shouldn't start with a PDE. The Black-Scholes-Merton equation is a PDE that lists the relationship between the greeks. You will need to differentiate with the solution of the PDE . You have listed the solution to the PDE for a call option in your first part of the question. You will need to do partial differentiation for the solution. $\frac{\partial^2 C}{\partial S^2}$ is the gamma of the option.
I could derive those for you but there are tons of material online that you can follow. Just remember, the PDE doesn't tell you anything without a boundary condition. The fact that you have listed the PDE but without a boundary condition for the call option isn't technically correct. Once you have a boundary condition, you'll be able to derive a solution. This solution is your first part of the question.
I think what you say seems correct. You just need to compute the conditional expectation (under the risk neutral measure) of $(S(T)-K)_+ 1_{\{S(T_0)>K_0\}}$. Now depending on whether $t<T_0$ or $t>T_0$ you can take out the indicator function out of the expectation or not by measurability. In the case that you can not things get trickier but not a big deal since you can separate $(S(T)-K)_+$ as
$$(S(T)-K)_+ =(S(T)-K) 1_{\{S(T)>K\}}$$
And now the product of indicator functions is the indicator that both events occur:
$$1_{\{S(T)>K\}}1_{\{S(T_0)>K_0\}}=1_{\{S(T)>K,S(T_0)>K_0\}}$$
From here you may use the same trick that $S(T)/S(t)$ and $S(T_0)/S(t)$ are independent of $S(t)$. But, careful, they are not independent of each other. So you may need to condition your expectation on both $S(T_0)$ and $S(t)$ (the latter only if you want to find the price at any time $t$). Maybe also by writing: $S(T)=S(T)/S(T_0)* S(T_0)/S(t)*S(t)$ and use independence to compute the expectation by conditioning.
Hope it helped.
I add more details here but I assume $r=0$ for notational simplicity, you have to add $e^{-t(T-t)}$ for discounting: If $0<T_0<t<T$ then $1_{\{S(T_0)>K_0\}}$ has been observed and we have under the risk neutral measure $Q$:
$$p(t) = E_Q [(S(T)-K)_+ 1_{\{S(T_0)>K_0\}}|\mathcal{F}_t]=1_{\{S(T_0)>K_0\}}E_Q [(S(T)-K)_+|\mathcal{F}_t]$$
which is either 0 or equal to the usual Black-Scholes price if $S(T_0)>K_0$ obviously. Hence, the interesting part is when $0<t<T_0<T$ and $S(T_0)$ has yet not been observed. Observe that
$$\frac{S(T)}{S(t)} = e^{\left(\mu-\frac{1}{2}\sigma^2\right)(T-t)+\sigma (W_T-W_t)},$$
where $W$ is the driving Brownian noise in $S$. In the above you can see that $W_T-W_t$ is independent of $W_t$ and hence $S(T)/S(t)$is independent of $S(t)$ for any $0\leq t<T$. We can thus condition on $S(T_0)$ and use this fact:
\begin{align*}
p(t) &= E_Q [(S(T)-K)_+ 1_{\{S(T_0)>K_0\}}|\mathcal{F}_t]=E_Q [(S(T)-K) 1_{\{S(T)>K,S(T_0)>K\}}|\mathcal{F}_t]\\
&=E_Q [S(T)1_{\{S(T)>K,S(T_0)>K_0\}}|\mathcal{F}_t]-KE_Q [ 1_{\{S(T)>K,S(T_0)>K_0\}}|\mathcal{F}_t] \\
\end{align*}
I explain the first one a little bit then you can do the second term: now writing $S(T)=\frac{S(T)}{S(t)}S(t)$ and $S(T_0)=\frac{S(T_0)}{S(t)}S(t)$ we can write:
\begin{align*}
E_Q [S(T)1_{\{S(T)>K,S(T_0)>K\}}|\mathcal{F}_t] = S(t) E_Q [\frac{S(T)}{S(t)}1_{\{\frac{S(T)}{S(t)}>\frac{K}{S(t)},\frac{S(T_0)}{S(t)}>\frac{K_0}{S(t)}\}}|\mathcal{F}_t] \\
\end{align*}
where I took $S(t)$ out of the expectation since $S(t)$ is $\mathcal{F}_t$-measurable. Now everything in the expectation is independent of $\mathcal{F}_t$ so we can just compute:
\begin{align*}
S(t) E_Q [\frac{S(T)}{S(t)}1_{\{\frac{S(T)}{S(t)}>\frac{K}{S(t)},\frac{S(T_0)}{S(t)}>\frac{K_0}{S(t)}\}}]
\end{align*}
which is a usual expectation. The rest is analogous to the derivation of the Black-Scholes formula via expectation: change from $Q$to $P$ (Girsanov) and use that $\log(\frac{S(T)}{S(0)})$ are normally distributed
\begin{align*}
S(t) E_Q [\frac{S(T)}{S(t)}1_{\{\frac{S(T)}{S(t)}>\frac{K}{S(t)},\frac{S(T_0)}{S(t)}>\frac{K_0}{S(t)}\}}]=S(t) E_Q [\frac{S(T)}{S(t)}1_{\{\log(S(T)/S(0))>\log(K/S(0)),\log(S(T_0)/S(0))>\log(K_0/S(0))\}}]
\end{align*}
and now you can proceed, but! careful here, because the normally distributed random variables $\log(S(T)/S(0))$ and $\log(S(T_0)/S(0))$ are not independent, so you may need to derive the bivariate density of $(\log(S(T)/S(0)),\log(S(T_0)/S(0)) )$ or use the trick $\log(S(T)/S(T_0)*S(T_0)/S(0))$ and $\log(S(T_0)/S(0))$ and here $S(T)/S(T_0)$ is independent of $S(T_0)/S(0)$ so you can condition on $S(T_0)/S(0)$ first, compute the expectation w.r.t. $S(T)/S(T_0)$ first letting $S(T_0)/S(0)$ be untouched, then average further $S(T_0)/S(0)$.
Best Answer
It's actually a pricing model for options, not shares (which is what stock markets trade). But either way, the reason compounding may be taken as continuous is because prices respond to supply and demand very rapidly. Suppose in the split-second $dt$ the price takes to update, it multiplies by $1+r dt$. Then in a time $t$, this becomes $(1+r dt)^{t/dt}\approx e^{rt}$ (for backward rates, just change the sign of $r$).