# Defining a function with a point of finite discontinuity [closed]

I wrote the code for the function $$T$$ defined on $$[0,1]$$ by $$T(x)=\frac{x+2}{3}$$ if $$x\neq\frac{1}{2}$$ and $$T(\frac{1}{2})=1$$ as follows.

T[x_] := If[x != 1/2, (2*x + 1)/3, 1];


I am not sure if the code I wrote defines the function $$T$$ correctly as the command Plot' fails to highlight the discontinuity at $$\frac{1}{2}$$.

A clarification to my doubt will be highly appreciated. Thanks!

## closed as off-topic by MarcoB, m_goldberg, Henrik Schumacher, march, bobthechemistDec 19 '18 at 19:05

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, m_goldberg, Henrik Schumacher, bobthechemist
If this question can be reworded to fit the rules in the help center, please edit the question.

• Probably better to use Piecewise[] – Michael E2 Dec 17 '18 at 14:47
• You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful – Michael E2 Dec 17 '18 at 14:47
• Use Piecewise and see the answers here. – march Dec 17 '18 at 16:42
• Possible duplicate of Plot a piecewise function with black and white disks marking discontinuities – march Dec 19 '18 at 17:25

f[x_] := Piecewise[{{(x + 2)/3, x != 1/2}, {1, x == 1/2}}]

• To show the actual value at the discontinuity: Plot[f[x], {x, 0, 1}, ExclusionsStyle -> {Dotted, Directive[White, AbsolutePointSize[3]]}, Epilog -> {Red, AbsolutePointSize[5], Point[{1/2, f[1/2]}]}]` – Bob Hanlon Dec 17 '18 at 17:05