PROBLEM: $\frac{dy}{dx} = y^2$ with $y = 1$ at $x = 0$. I have solved the problem and graphed it too but just can't understand the graph MIT has given it in the solution.
$$\frac{dy}{dx} = y^2 \iff \frac{dy}{y^2} = dx \iff \int\frac{dy}{y^2} = \int dx \iff \int y^{-2}dy = \int dx $$
$$ -y^{-1} = x + C \iff \frac{-1}{y} = x + C \iff y = \frac{-1}{x + C} $$
From condition $y = 1$ at $x = 0$, we get: $$ y = \frac{1}{1-x} $$


You have merely plotted the function $$y = \frac{1}{1-x}$$ for all $x\ne1$.
MIT have plotted the solution of the differential equation, which coincides with your function for $x<1$. The initial condition is to the left of the discontinuity. The domain of the solution is $(-\infty,1)$.
There are no conditions given to the right of the discontinuity, and as they state any $$y = \frac{1}{c-x}$$ for $c>1$ is a solution to the differential equation, in the region $x>1$ and you need a condition in the domain of that branch to determine $c$.
The domain of the function $$y = \frac{1}{1-x}$$ for $x>1$ is $(1, \infty)$ which does not contain the given initial condition.