There are really three questions here and they are not testing the same thing. The first is mechanical: can I work from the definition without reaching for a rule. The other two are about the logic between continuity and differentiability, and I will answer those with proofs rather than opinions.
For part one the only thing I write down is the difference quotient. I am deliberately not using the product rule, because this calculation is the product rule's proof in one particular case: using the rule here would be circular. What I am allowed is the angle-addition formula for sine, two elementary limits, and continuity.
One decision before I start: x stays a symbol. If I put a number in for x I get a number instead of a function, and if I ever divide by x I silently lose the case x equals nought. So x is arbitrary but fixed, and h is the thing that tends to nought.
Two expansions do all the work. Sine of a sum is sine x cosine h plus cosine x sine h. It is not sine x plus sine h, and that one slip is the usual way to lose this question. And x plus h squared is x squared plus two x h plus h squared.
I multiply out and regroup by hand into three pieces, A, B and C, chosen so that each one wants exactly one limit: A wants the cosine one, B wants the sine one, and C will need nothing beyond continuity. Structurally this is the product rule's own proof split: the increment of u times the shifted v, plus u times the increment of v, with the second bracket then opened by the angle formula.
Before I pass to any limit I check the regrouping as an identity at a concrete pair of numbers. At x equals one and h equals a tenth, f of 1.1 minus f of 1 is 0.236890, and so is A plus B plus C. Cheap insurance, and it catches sign errors that no amount of staring will find.
Let me draw the object I claim exists, because the definition is a statement about slopes and I want to see one. The amber curve is y equals x squared sine x; the point I am standing on is x equals one, f of one, which is 0.8415.
The three grey lines are chords through that point and a second point at q equals 0.2, 0.5 and 0.75. Their slopes are 1.0419, 1.4432 and 1.8322; plainly climbing. The blue line is the tangent, slope 2.2232, which is 2 times sine of 1 plus cosine of 1.
So the difference quotient is not an abstraction: it is the reading of a slope while the second intersection slides in. What the drawing does not do is prove anything for general x. It fixes the target; the algebra has to deliver it.
Now one limit at a time, and I only split the limit into three because each part provably converges on its own. A over h is x squared sine x times cosine h minus one over h, and that quotient tends to nought. B over h is x squared cosine x times sine h over h, and that tends to one. For C the h cancels against the h inside two x h plus h squared, leaving two x plus h times sine of x plus h, which tends to two x sine x by continuity of sine alone: no third borrowed fact.
Adding the three gives x squared cosine x plus two x sine x, and notice that came out of the definition and nothing else.
Also notice where the halves came from. The x squared cosine x is piece B, the two x sine x is piece C. The angle-addition formula created the extra piece A, and A is exactly the term that has to vanish, and it does, at the rate h over two.
I do not trust a first-principles answer until I have seen it numerically. At x equals one the formula predicts 2.223244. With h equal to a tenth the quotient gives 2.368899; with a hundredth, 2.238218; with a thousandth, 2.224745. It is closing on the target.
The errors are 0.145655, 0.014974 and 0.001501. Divide each error by h and you get 1.4565, 1.4974 and 1.5009; settling on 1.5. That is not luck: the chord slope should be wrong by half of f double prime at one, times h, and f double prime of one is sine of 1 plus 4 times cosine of 1, which is 3.002680. Its half is 1.501340. Agreement to three decimals tells me the quotient, the arithmetic and the formula are the same object.
The case I actually worried about is x equals nought, where the h in the denominator is doing all the work. There the quotient is exactly h sine h, which at a thousandth is 9.999998 times ten to the minus seven, heading to nought, as the formula promises. And from h equals minus a thousandth at x equals one the quotient is 2.221743, the mirror image of the plus side, so nothing here is a one-sided trick.
Those two limits are the only facts I have borrowed, so they need proving from geometry rather than from a table. The first is the sector squeeze. The triangle with base one and height sine h lies inside the sector of angle h, which lies inside the tangent triangle with height tangent h. Their areas are a half sine h, a half h, and a half tangent h, so sine h is at most h, and h is at most tangent h. Divide by sine h and invert, and you get cosine h at most sine h over h at most one. Cosine h tends to one by continuity, so the squeeze hands over the limit one. For negative h nothing changes, because both the numerator and the denominator flip sign.
The second fact falls out of the first by conjugating. Multiply top and bottom of cosine h minus one over h by cosine h plus one; the numerator becomes cosine squared h minus one, that is minus sine squared h. Split it into minus sine h over h, times sine h over one plus cosine h, and the limit is minus one times nought over two, which is nought. That is why piece A vanishes, and it also shows it vanishes like h over two: at h equal to a thousandth, the board figure for the quotient is minus 0.0005.
What I did not do is call l'Hopital on sine h over h. That rule needs the derivative of sine, which is precisely what this exercise is proving, so it would assume the answer. If somebody asks for the derivative of sine from first principles, the squeeze is the honest route.
Second route, purely as a check. If I allow myself the rule I refused earlier, the product rule gives two x sine x plus x squared cosine x, the same function. Two methods agree, so the answer is not an artefact of my algebra.
More to the point, look where the pieces landed. A plus B is x squared times the increment of sine, which is u times the increment of v. C is the increment of u times v, read at x plus h. Divide by h and let h go to nought, and I have just derived the product rule for this pair of functions.
Nothing about x squared and sine was special, so the same three lines prove the rule for any differentiable u and v. One hypothesis is worth naming: passing from v of x plus h to v of x needs v to be continuous at x, and differentiability gives that for free.
Part b: no, and the reason is two lines. Suppose the derivative exists at x. Write the increment as h times the difference quotient. That quotient tends to f prime of x, so the product of the two limits is nought times f prime of x, which is nought. But saying the increment tends to nought is exactly continuity at the point. No extra hypotheses and no exceptions: differentiability at a point forces continuity at that point, and the contrapositive is the answer to b.
The failure is visible in the quotient, and I would rather quote numbers than say the slope is infinite. For a step at the origin the right-hand quotient is one over h, which is 1000 at h equal to a thousandth, while the left-hand quotient is identically nought. The two one-sided behaviours do not agree, so there is no limit at all, finite or infinite.
And a hole is as fatal as a jump. Define f to be sine x over x with f of nought equal to nought: that is discontinuous, and its quotient at a thousandth is 999.9998, blowing up like one over h. Repair the hole by defining f of nought to be one, and the quotient becomes minus h over six, which tends to nought, so the repaired function is differentiable at nought, with derivative nought. Continuity is the gate, and in this example opening it is enough to let differentiability through.
Part c asks whether the converse can fail everywhere at once. Once is easy: the absolute value has a corner at nought and is smooth elsewhere. Everywhere needs a real witness, and here is one you can write down. Take the distance from t to the nearest integer, the grey triangle of height a half, and sum it at doubling frequency and halving height.
Continuity first, because this is the step people hand-wave. Each term is bounded by two to the minus n, the geometric series of those bounds converges, so the sum converges uniformly by the M-test, and a uniform limit of continuous functions is continuous. Uniformness is genuinely needed: x to the n on the interval from nought to one converges pointwise to a function that is nought inside and one at the end, and that limit is discontinuous.
Now the slopes. Level n is a zigzag of width two to the minus n whose pieces have slope plus or minus one exactly: halving the height and doubling the frequency cancel. So each new level shifts the chord slope over that window by another one, forever; the slopes never settle. At the origin I can compute it outright: T of two to the minus n is n times two to the minus n, because the first n levels each contribute two to the minus n and the rest are exact zeros. So the difference quotient at h equal to two to the minus n is exactly n, namely one, two, three, four, five, as the orange chords show. The chord slopes run away, so there is no tangent at nought.
At a typical point they do not run away, they oscillate, which is the more honest picture: at x equal to a third, in exact arithmetic, the one-sided quotients along h equal to plus and minus two to the minus n sit on four values forever: nought and minus a third from the right, and one and four thirds in absolute value from the left. Bounded, and still no derivative. So the answers are: part a, x squared cosine x plus two x sine x; part b, no, because differentiability forces continuity; and part c, yes, with Takagi's function as the witness. The only implication on the board runs one way, and the interesting boundary is that smoothness is the exception, not the rule: in the space of all continuous functions the nowhere-differentiable ones are generic.
It enters in exactly one place: the limit of sine h over h. The algebra, the three-piece split and the squeeze argument are all unit-free, but that single limit is where the choice of angle unit lands.
Feed the calculator an angle in degrees and the quotient stops at pi over 180. I get 0.0174524 at one degree, 0.01745328 at a tenth of a degree, and 0.0174532924 at a hundredth, converging to 0.0174532925, which is pi over 180.
So in degree measure the derivative of sine is pi over one hundred and eighty times cosine, and my answer would become two x sine x plus pi over one hundred and eighty times x squared cosine x. The factor hits piece B only, because piece C never touched that limit. Radians are not a convention here; they are the normalisation that makes that one limit equal to one and keeps the whole table of derivatives clean.
Not necessarily, and it is worth having the witness ready. Take g of x equals x squared sine of one over x, with g of nought defined to be nought. At the origin the quotient is h sine of one over h, whose size is at most the size of h, so it tends to nought: g is differentiable at nought with derivative nought. Away from zero everything is smooth and the derivative is two x sine of one over x minus cosine of one over x.
That cosine term has no limit at nought. Put x equal to one over 200 pi, which is 0.00159155; then one over x is a whole multiple of two pi, the first term is negligible and the derivative is minus one. Put x equal to one over 399 pi, which is 0.00079777, and the cosine is minus one, so the derivative is plus one. Two points both within two thousandths of the origin where the derivative is two units apart.
So g is differentiable everywhere with a discontinuous derivative. Differentiable does not mean continuously differentiable; that is a bullet my x squared sine x happens to dodge, since it is smooth.
It is sufficient, not necessary, and I would rather show you the gap than claim it away. Take u of x equals x and v of x equals the absolute value of x. Their product is x times the absolute value of x, and at the origin its difference quotient is h times the modulus of h over h, which is just the modulus of h: 0.1, 0.01 and 0.001 for the three h's I tried. So the product is differentiable at nought with derivative nought, while the absolute value is not differentiable there.
The mechanism is that a zero of one factor can absorb a corner of the other, the same absorption that made x squared tame the oscillation of sine of one over x in the previous question. My computation only ever used the existence of the two limits, so it proves the forward direction and gives no verdict when one of them fails.
At the origin the failure is blunt: the chord slopes are exactly n, so they run off. At a typical point they do not run off, they oscillate, which is why I would not try to prove the general theorem from the picture: Takagi's nineteen nought three argument has to track, at every point, which side of every triangle's peak the step lands on.
There is a clean way to see both at once. Over a step of two to the minus n only the first n levels move, and each of them moves by at most two to the minus n, so the function moves by at most n times two to the minus n, with equality at the origin. That bound still tends to nought, which is exactly why the function is continuous; divided by the step it is n, which is exactly why there is no derivative. The modulus of continuity is of order h log of one over h, so the function is Holder of every exponent below one and not Lipschitz at all.
For a completely different mechanism, Brownian sample paths are almost surely continuous and nowhere differentiable; there the failure comes from oscillation on every scale rather than from a fixed zigzag.